summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-07-08 22:59:59 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-07-08 22:59:59 +1000
commitb9aa0a0baa33efb06a773de18f2b45c12c15cbaf (patch)
tree88e63239d15bca8deb7fee0bda994b7f0cb746fa /auth-passwd.c
parent793e817d491b5081d2a156b546ae06f28d11a737 (diff)
- (dtucker) [auth-passwd.c auth.c session.c sshd.c port-aix.c port-aix.h]
Convert aixloginmsg into platform-independant Buffer loginmsg.
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index ea65a0125..f078eddd5 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -42,6 +42,8 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $");
42#include "log.h" 42#include "log.h"
43#include "servconf.h" 43#include "servconf.h"
44#include "auth.h" 44#include "auth.h"
45#include "buffer.h"
46#include "xmalloc.h"
45#include "canohost.h" 47#include "canohost.h"
46 48
47#if !defined(HAVE_OSF_SIA) 49#if !defined(HAVE_OSF_SIA)
@@ -79,9 +81,7 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $");
79#endif /* !HAVE_OSF_SIA */ 81#endif /* !HAVE_OSF_SIA */
80 82
81extern ServerOptions options; 83extern ServerOptions options;
82#ifdef WITH_AIXAUTHENTICATE 84extern Buffer loginmsg;
83extern char *aixloginmsg;
84#endif
85 85
86/* 86/*
87 * Tries to authenticate the user using password. Returns true if 87 * Tries to authenticate the user using password. Returns true if
@@ -149,15 +149,29 @@ auth_password(Authctxt *authctxt, const char *password)
149# endif 149# endif
150# ifdef WITH_AIXAUTHENTICATE 150# ifdef WITH_AIXAUTHENTICATE
151 authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0); 151 authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0);
152 aix_remove_embedded_newlines(authmsg);
152 153
153 if (authsuccess) { 154 if (authsuccess) {
155 char *msg;
156 char *host = (char *)get_canonical_hostname(options.use_dns);
157
158 debug3("AIX/authenticate succeeded for user %s: %.100s",
159 pw->pw_name, authmsg);
160
154 /* We don't have a pty yet, so just label the line as "ssh" */ 161 /* We don't have a pty yet, so just label the line as "ssh" */
155 if (loginsuccess(authctxt->user, 162 if (loginsuccess(authctxt->user, host, "ssh", &msg) == 0){
156 get_canonical_hostname(options.use_dns), 163 if (msg != NULL) {
157 "ssh", &aixloginmsg) < 0) { 164 debug("%s: msg %s", __func__, msg);
158 aixloginmsg = NULL; 165 buffer_append(&loginmsg, msg, strlen(msg));
166 xfree(msg);
167 }
159 } 168 }
169 } else {
170 debug3("AIX/authenticate failed for user %s: %.100s",
171 pw->pw_name, authmsg);
160 } 172 }
173 if (authmsg != NULL)
174 xfree(authmsg);
161 175
162 return (authsuccess); 176 return (authsuccess);
163# endif 177# endif