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)
downloadopenssh-git-b9aa0a0baa33efb06a773de18f2b45c12c15cbaf.tar.gz
- (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 ea65a012..f078eddd 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 $");
#include "log.h"
#include "servconf.h"
#include "auth.h"
+#include "buffer.h"
+#include "xmalloc.h"
#include "canohost.h"
#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 $");
#endif /* !HAVE_OSF_SIA */
extern ServerOptions options;
-#ifdef WITH_AIXAUTHENTICATE
-extern char *aixloginmsg;
-#endif
+extern Buffer loginmsg;
/*
* Tries to authenticate the user using password. Returns true if
@@ -149,15 +149,29 @@ auth_password(Authctxt *authctxt, const char *password)
# endif
# ifdef WITH_AIXAUTHENTICATE
authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0);
+ aix_remove_embedded_newlines(authmsg);
if (authsuccess) {
+ char *msg;
+ char *host = (char *)get_canonical_hostname(options.use_dns);
+
+ debug3("AIX/authenticate succeeded for user %s: %.100s",
+ pw->pw_name, authmsg);
+
/* We don't have a pty yet, so just label the line as "ssh" */
- if (loginsuccess(authctxt->user,
- get_canonical_hostname(options.use_dns),
- "ssh", &aixloginmsg) < 0) {
- aixloginmsg = NULL;
+ if (loginsuccess(authctxt->user, host, "ssh", &msg) == 0){
+ if (msg != NULL) {
+ debug("%s: msg %s", __func__, msg);
+ buffer_append(&loginmsg, msg, strlen(msg));
+ xfree(msg);
+ }
}
+ } else {
+ debug3("AIX/authenticate failed for user %s: %.100s",
+ pw->pw_name, authmsg);
}
+ if (authmsg != NULL)
+ xfree(authmsg);
return (authsuccess);
# endif