diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-08-08 13:43:37 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-08-08 13:43:37 +1000 |
commit | f38db7f5dae83b5aeeab681edd266a62b3ebc1f6 (patch) | |
tree | 03d78b6d7cabeeb73021322d9f6c346228dd6a4b /auth-pam.c | |
parent | 65914f1eb3e05694d64e540ff1bf3b8387795657 (diff) |
- (dtucker) [auth-pam.c] Don't set PAM_TTY if tty is null. ok djm@
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -31,7 +31,7 @@ /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" -RCSID("$Id: auth-pam.c,v 1.65 2003/07/30 04:53:11 djm Exp $"); +RCSID("$Id: auth-pam.c,v 1.66 2003/08/08 03:43:37 dtucker Exp $"); #ifdef USE_PAM #include <security/pam_appl.h> @@ -534,11 +534,13 @@ do_pam_session(const char *user, const char *tty) if (sshpam_err != PAM_SUCCESS) fatal("PAM: failed to set PAM_CONV: %s", pam_strerror(sshpam_handle, sshpam_err)); - debug("PAM: setting PAM_TTY to \"%s\"", tty); - sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, tty); - if (sshpam_err != PAM_SUCCESS) - fatal("PAM: failed to set PAM_TTY: %s", - pam_strerror(sshpam_handle, sshpam_err)); + if (tty != NULL) { + debug("PAM: setting PAM_TTY to \"%s\"", tty); + sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, tty); + if (sshpam_err != PAM_SUCCESS) + fatal("PAM: failed to set PAM_TTY: %s", + pam_strerror(sshpam_handle, sshpam_err)); + } sshpam_err = pam_open_session(sshpam_handle, 0); if (sshpam_err != PAM_SUCCESS) fatal("PAM: pam_open_session(): %s", |