diff options
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/auth-pam.c b/auth-pam.c index 9ca18e77e..970ff61cb 100644 --- a/auth-pam.c +++ b/auth-pam.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ | 32 | /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ |
33 | #include "includes.h" | 33 | #include "includes.h" |
34 | RCSID("$Id: auth-pam.c,v 1.65 2003/07/30 04:53:11 djm Exp $"); | 34 | RCSID("$Id: auth-pam.c,v 1.66 2003/08/08 03:43:37 dtucker Exp $"); |
35 | 35 | ||
36 | #ifdef USE_PAM | 36 | #ifdef USE_PAM |
37 | #include <security/pam_appl.h> | 37 | #include <security/pam_appl.h> |
@@ -534,11 +534,13 @@ do_pam_session(const char *user, const char *tty) | |||
534 | if (sshpam_err != PAM_SUCCESS) | 534 | if (sshpam_err != PAM_SUCCESS) |
535 | fatal("PAM: failed to set PAM_CONV: %s", | 535 | fatal("PAM: failed to set PAM_CONV: %s", |
536 | pam_strerror(sshpam_handle, sshpam_err)); | 536 | pam_strerror(sshpam_handle, sshpam_err)); |
537 | debug("PAM: setting PAM_TTY to \"%s\"", tty); | 537 | if (tty != NULL) { |
538 | sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, tty); | 538 | debug("PAM: setting PAM_TTY to \"%s\"", tty); |
539 | if (sshpam_err != PAM_SUCCESS) | 539 | sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, tty); |
540 | fatal("PAM: failed to set PAM_TTY: %s", | 540 | if (sshpam_err != PAM_SUCCESS) |
541 | pam_strerror(sshpam_handle, sshpam_err)); | 541 | fatal("PAM: failed to set PAM_TTY: %s", |
542 | pam_strerror(sshpam_handle, sshpam_err)); | ||
543 | } | ||
542 | sshpam_err = pam_open_session(sshpam_handle, 0); | 544 | sshpam_err = pam_open_session(sshpam_handle, 0); |
543 | if (sshpam_err != PAM_SUCCESS) | 545 | if (sshpam_err != PAM_SUCCESS) |
544 | fatal("PAM: pam_open_session(): %s", | 546 | fatal("PAM: pam_open_session(): %s", |