Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/crypto/dist/ssh Pull up revision 1.13 (requested by ito...



details:   https://anonhg.NetBSD.org/src/rev/cac749dfd083
branches:  netbsd-1-6
changeset: 527567:cac749dfd083
user:      tv <tv%NetBSD.org@localhost>
date:      Tue May 28 19:27:28 2002 +0000

description:
Pull up revision 1.13 (requested by itojun):
correct rhosts authentication.  should fix PR 17023

diffstat:

 crypto/dist/ssh/auth.c |  50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diffs (82 lines):

diff -r 22276620910e -r cac749dfd083 crypto/dist/ssh/auth.c
--- a/crypto/dist/ssh/auth.c    Tue May 28 19:27:14 2002 +0000
+++ b/crypto/dist/ssh/auth.c    Tue May 28 19:27:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth.c,v 1.12 2002/04/22 07:59:36 itojun Exp $ */
+/*     $NetBSD: auth.c,v 1.12.2.1 2002/05/28 19:27:28 tv Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -41,6 +41,8 @@
 #include "uidswap.h"
 #include "tildexpand.h"
 #include "misc.h"
+#include "bufaux.h"
+#include "packet.h"
 
 #ifdef HAVE_LOGIN_CAP
 #include <login_cap.h>
@@ -49,6 +51,10 @@
 /* import */
 extern ServerOptions options;
 
+/* Debugging messages */
+Buffer auth_debug;
+int auth_debug_init;
+
 /*
  * Check if the user is allowed to log in via ssh. If user is listed
  * in DenyUsers or one of user's groups is listed in DenyGroups, false
@@ -517,7 +523,7 @@
        }
 #ifdef BSD_AUTH
        if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 ||
-           auth_approval(NULL, lc, pw->pw_name, "ssh") <= 0) {
+           auth_approval(as, lc, pw->pw_name, "ssh") <= 0) {
                debug("Approval failure for %s", user);
                pw = NULL;
        }
@@ -529,3 +535,43 @@
                return (pwcopy(pw));
        return (NULL);
 }
+
+void
+auth_debug_add(const char *fmt,...)
+{
+       char buf[1024];
+       va_list args;
+
+       if (!auth_debug_init)
+               return;
+
+       va_start(args, fmt);
+       vsnprintf(buf, sizeof(buf), fmt, args);
+       va_end(args);
+       buffer_put_cstring(&auth_debug, buf);
+}
+
+void
+auth_debug_send(void)
+{
+       char *msg;
+
+       if (!auth_debug_init)
+               return;
+       while (buffer_len(&auth_debug)) {
+               msg = buffer_get_string(&auth_debug, NULL);
+               packet_send_debug("%s", msg);
+               xfree(msg);
+       }
+}
+
+void
+auth_debug_reset(void)
+{
+       if (auth_debug_init)
+               buffer_clear(&auth_debug);
+       else {
+               buffer_init(&auth_debug);
+               auth_debug_init = 1;
+       }
+}



Home | Main Index | Thread Index | Old Index