- (djm) Fix mangled AIXAUTHENTICATE code
diff --git a/ChangeLog b/ChangeLog
index 79f9c7b..914891b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 20001028
  - (djm) fix select hack in serverloop.c from Philippe WILLEM 
    <Philippe.WILLEM@urssaf.fr>
+ - (djm) Fix mangled AIXAUTHENTICATE code
 
 20001027
  - (djm) Increase REKEY_BYTES to 2^24 for arc4random
diff --git a/auth2.c b/auth2.c
index 60f8f98..d3c05a7 100644
--- a/auth2.c
+++ b/auth2.c
@@ -193,7 +193,7 @@
 		fatal("input_userauth_request: no authctxt");
 	if (authctxt->attempt++ >= AUTH_FAIL_MAX) {
 #ifdef WITH_AIXAUTHENTICATE 
-		loginfailed(user,get_canonical_hostname(),"ssh");
+		loginfailed(authctxt->pw->pw_name, get_canonical_hostname(), "ssh");
 #endif /* WITH_AIXAUTHENTICATE */
 		packet_disconnect("too many failed userauth_requests");
 	}
@@ -306,8 +306,8 @@
 	if (authenticated == 1) {
 #ifdef WITH_AIXAUTHENTICATE
 		/* We don't have a pty yet, so just label the line as "ssh" */
-		if (loginsuccess(user, get_canonical_hostname(), "ssh",
-				&aixloginmsg) < 0)
+		if (loginsuccess(authctxt->pw->pw_name, get_canonical_hostname(), 
+			"ssh", &aixloginmsg) < 0)
 			aixloginmsg = NULL;
 #endif /* WITH_AIXAUTHENTICATE */
 		/* turn off userauth */