summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-11-22 14:16:56 +1100
committerDarren Tucker <dtucker@zip.com.au>2003-11-22 14:16:56 +1100
commitd76341616dfebd4addc9c9594767ab1832ccb100 (patch)
treec47fc617084c1c068e065a11b633db595e262fd1 /auth-passwd.c
parent0eae4422350c4903a23d20b8a5153f939d721428 (diff)
- (dtucker) [auth-passwd.c openbsd-compat/port-aix.c openbsd-compat/port-aix.h]
Move AIX specific password authentication code to port-aix.c, call authenticate() until reenter flag is clear.
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index 54571f972..a27170ccc 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -43,9 +43,7 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.30 2003/11/04 08:54:09 djm Exp $");
43#include "servconf.h" 43#include "servconf.h"
44#include "auth.h" 44#include "auth.h"
45#ifdef WITH_AIXAUTHENTICATE 45#ifdef WITH_AIXAUTHENTICATE
46# include "buffer.h"
47# include "canohost.h" 46# include "canohost.h"
48extern Buffer loginmsg;
49#endif 47#endif
50 48
51extern ServerOptions options; 49extern ServerOptions options;
@@ -89,44 +87,11 @@ auth_password(Authctxt *authctxt, const char *password)
89 } 87 }
90# endif 88# endif
91# ifdef WITH_AIXAUTHENTICATE 89# ifdef WITH_AIXAUTHENTICATE
92 { 90 if (aix_authenticate(pw->pw_name, password,
93 char *authmsg = NULL; 91 get_canonical_hostname(options.use_dns)) == 0)
94 int reenter = 1; 92 return 0;
95 int authsuccess = 0; 93 else
96 94 return ok;
97 if (authenticate(pw->pw_name, password, &reenter,
98 &authmsg) == 0 && ok) {
99 char *msg;
100 char *host =
101 (char *)get_canonical_hostname(options.use_dns);
102
103 authsuccess = 1;
104 aix_remove_embedded_newlines(authmsg);
105
106 debug3("AIX/authenticate succeeded for user %s: %.100s",
107 pw->pw_name, authmsg);
108
109 /* No pty yet, so just label the line as "ssh" */
110 aix_setauthdb(authctxt->user);
111 if (loginsuccess(authctxt->user, host, "ssh",
112 &msg) == 0) {
113 if (msg != NULL) {
114 debug("%s: msg %s", __func__, msg);
115 buffer_append(&loginmsg, msg,
116 strlen(msg));
117 xfree(msg);
118 }
119 }
120 } else {
121 debug3("AIX/authenticate failed for user %s: %.100s",
122 pw->pw_name, authmsg);
123 }
124
125 if (authmsg != NULL)
126 xfree(authmsg);
127
128 return authsuccess;
129 }
130# endif 95# endif
131# ifdef BSD_AUTH 96# ifdef BSD_AUTH
132 if (auth_userokay(pw->pw_name, authctxt->style, "auth-ssh", 97 if (auth_userokay(pw->pw_name, authctxt->style, "auth-ssh",