summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authordtucker <dtucker>2003-07-08 12:59:59 +0000
committerdtucker <dtucker>2003-07-08 12:59:59 +0000
commit5e327873dcabc0754dc56878426e1e2501977334 (patch)
treed79e8f6aae24e99d060a1f077dc908d79dcebdec /auth-passwd.c
parentd2b29cf5c8ff59e208048a03648b9ea1cd26c0a0 (diff)
downloadopenssh-5e327873dcabc0754dc56878426e1e2501977334.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