diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | auth2.c | 17 |
2 files changed, 11 insertions, 8 deletions
@@ -2,6 +2,8 @@ | |||
2 | - (djm) fix select hack in serverloop.c from Philippe WILLEM | 2 | - (djm) fix select hack in serverloop.c from Philippe WILLEM |
3 | <Philippe.WILLEM@urssaf.fr> | 3 | <Philippe.WILLEM@urssaf.fr> |
4 | - (djm) Fix mangled AIXAUTHENTICATE code | 4 | - (djm) Fix mangled AIXAUTHENTICATE code |
5 | - (djm) authctxt->pw may be NULL. Fix from Markus Friedl | ||
6 | <markus.friedl@informatik.uni-erlangen.de> | ||
5 | - (djm) Sync with OpenBSD: | 7 | - (djm) Sync with OpenBSD: |
6 | - markus@cvs.openbsd.org 2000/10/16 15:46:32 | 8 | - markus@cvs.openbsd.org 2000/10/16 15:46:32 |
7 | [ssh.1] | 9 | [ssh.1] |
@@ -193,7 +193,8 @@ input_userauth_request(int type, int plen, void *ctxt) | |||
193 | fatal("input_userauth_request: no authctxt"); | 193 | fatal("input_userauth_request: no authctxt"); |
194 | if (authctxt->attempt++ >= AUTH_FAIL_MAX) { | 194 | if (authctxt->attempt++ >= AUTH_FAIL_MAX) { |
195 | #ifdef WITH_AIXAUTHENTICATE | 195 | #ifdef WITH_AIXAUTHENTICATE |
196 | loginfailed(authctxt->pw->pw_name, get_canonical_hostname(), "ssh"); | 196 | loginfailed(authctxt->user?authctxt->user:"NOUSER", |
197 | get_canonical_hostname(), "ssh"); | ||
197 | #endif /* WITH_AIXAUTHENTICATE */ | 198 | #endif /* WITH_AIXAUTHENTICATE */ |
198 | packet_disconnect("too many failed userauth_requests"); | 199 | packet_disconnect("too many failed userauth_requests"); |
199 | } | 200 | } |
@@ -250,7 +251,7 @@ input_userauth_request(int type, int plen, void *ctxt) | |||
250 | } | 251 | } |
251 | 252 | ||
252 | #ifdef USE_PAM | 253 | #ifdef USE_PAM |
253 | if (authenticated && !do_pam_account(authctxt->pw->pw_name, NULL)) | 254 | if (authenticated && authctxt->user && !do_pam_account(authctxt->user, NULL)) |
254 | authenticated = 0; | 255 | authenticated = 0; |
255 | #endif /* USE_PAM */ | 256 | #endif /* USE_PAM */ |
256 | 257 | ||
@@ -306,8 +307,8 @@ userauth_reply(Authctxt *authctxt, int authenticated) | |||
306 | if (authenticated == 1) { | 307 | if (authenticated == 1) { |
307 | #ifdef WITH_AIXAUTHENTICATE | 308 | #ifdef WITH_AIXAUTHENTICATE |
308 | /* We don't have a pty yet, so just label the line as "ssh" */ | 309 | /* We don't have a pty yet, so just label the line as "ssh" */ |
309 | if (loginsuccess(authctxt->pw->pw_name, get_canonical_hostname(), | 310 | if (loginsuccess(authctxt->user?authctxt->user:"NOUSER", |
310 | "ssh", &aixloginmsg) < 0) | 311 | get_canonical_hostname(), "ssh", &aixloginmsg) < 0) |
311 | aixloginmsg = NULL; | 312 | aixloginmsg = NULL; |
312 | #endif /* WITH_AIXAUTHENTICATE */ | 313 | #endif /* WITH_AIXAUTHENTICATE */ |
313 | /* turn off userauth */ | 314 | /* turn off userauth */ |
@@ -350,8 +351,8 @@ userauth_none(Authctxt *authctxt) | |||
350 | return auth_pam_password(authctxt->pw, ""); | 351 | return auth_pam_password(authctxt->pw, ""); |
351 | #elif defined(HAVE_OSF_SIA) | 352 | #elif defined(HAVE_OSF_SIA) |
352 | return (sia_validate_user(NULL, saved_argc, saved_argv, | 353 | return (sia_validate_user(NULL, saved_argc, saved_argv, |
353 | get_canonical_hostname(), authctxt->pw->pw_name, NULL, | 354 | get_canonical_hostname(), authctxt->user?authctxt->user:"NOUSER", |
354 | 0, NULL, "") == SIASUCCESS); | 355 | NULL, 0, NULL, "") == SIASUCCESS); |
355 | #else /* !HAVE_OSF_SIA && !USE_PAM */ | 356 | #else /* !HAVE_OSF_SIA && !USE_PAM */ |
356 | return auth_password(authctxt->pw, ""); | 357 | return auth_password(authctxt->pw, ""); |
357 | #endif /* USE_PAM */ | 358 | #endif /* USE_PAM */ |
@@ -377,8 +378,8 @@ userauth_passwd(Authctxt *authctxt) | |||
377 | auth_pam_password(authctxt->pw, password) == 1) | 378 | auth_pam_password(authctxt->pw, password) == 1) |
378 | #elif defined(HAVE_OSF_SIA) | 379 | #elif defined(HAVE_OSF_SIA) |
379 | sia_validate_user(NULL, saved_argc, saved_argv, | 380 | sia_validate_user(NULL, saved_argc, saved_argv, |
380 | get_canonical_hostname(), authctxt->pw->pw_name, NULL, 0, | 381 | get_canonical_hostname(), authctxt->user?authctxt->user:"NOUSER", |
381 | NULL, password) == SIASUCCESS) | 382 | NULL, 0, NULL, password) == SIASUCCESS) |
382 | #else /* !USE_PAM && !HAVE_OSF_SIA */ | 383 | #else /* !USE_PAM && !HAVE_OSF_SIA */ |
383 | auth_password(authctxt->pw, password) == 1) | 384 | auth_password(authctxt->pw, password) == 1) |
384 | #endif /* USE_PAM */ | 385 | #endif /* USE_PAM */ |