summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-05-15 16:16:14 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-05-15 16:16:14 +0000
commita574cda45b5d3c3363520ef9e4aa3aaa5888c078 (patch)
treee437d6e854db91fd3a9744d922ff942f465b249a /auth.c
parent58d4dafeb1159cebd03a2b32cb87a1970606a441 (diff)
- markus@cvs.openbsd.org 2002/05/13 20:44:58
[auth-options.c auth.c auth.h] move the packet_send_debug handling from auth-options.c to auth.c; ok provos@
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/auth.c b/auth.c
index 2f1979cfa..7c2faeed1 100644
--- a/auth.c
+++ b/auth.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth.c,v 1.41 2002/03/19 15:31:47 markus Exp $"); 26RCSID("$OpenBSD: auth.c,v 1.42 2002/05/13 20:44:58 markus Exp $");
27 27
28#ifdef HAVE_LOGIN_H 28#ifdef HAVE_LOGIN_H
29#include <login.h> 29#include <login.h>
@@ -49,10 +49,16 @@ RCSID("$OpenBSD: auth.c,v 1.41 2002/03/19 15:31:47 markus Exp $");
49#include "uidswap.h" 49#include "uidswap.h"
50#include "tildexpand.h" 50#include "tildexpand.h"
51#include "misc.h" 51#include "misc.h"
52#include "bufaux.h"
53#include "packet.h"
52 54
53/* import */ 55/* import */
54extern ServerOptions options; 56extern ServerOptions options;
55 57
58/* Debugging messages */
59Buffer auth_debug;
60int auth_debug_init;
61
56/* 62/*
57 * Check if the user is allowed to log in via ssh. If user is listed 63 * Check if the user is allowed to log in via ssh. If user is listed
58 * in DenyUsers or one of user's groups is listed in DenyGroups, false 64 * in DenyUsers or one of user's groups is listed in DenyGroups, false
@@ -491,3 +497,43 @@ getpwnamallow(const char *user)
491 return (pwcopy(pw)); 497 return (pwcopy(pw));
492 return (NULL); 498 return (NULL);
493} 499}
500
501void
502auth_debug_add(const char *fmt,...)
503{
504 char buf[1024];
505 va_list args;
506
507 if (!auth_debug_init)
508 return;
509
510 va_start(args, fmt);
511 vsnprintf(buf, sizeof(buf), fmt, args);
512 va_end(args);
513 buffer_put_cstring(&auth_debug, buf);
514}
515
516void
517auth_debug_send(void)
518{
519 char *msg;
520
521 if (!auth_debug_init)
522 return;
523 while (buffer_len(&auth_debug)) {
524 msg = buffer_get_string(&auth_debug, NULL);
525 packet_send_debug("%s", msg);
526 xfree(msg);
527 }
528}
529
530void
531auth_debug_reset(void)
532{
533 if (auth_debug_init)
534 buffer_clear(&auth_debug);
535 else {
536 buffer_init(&auth_debug);
537 auth_debug_init = 1;
538 }
539}