summaryrefslogtreecommitdiff
path: root/auth-pam.c
diff options
context:
space:
mode:
authordtucker <dtucker>2003-08-08 03:43:37 +0000
committerdtucker <dtucker>2003-08-08 03:43:37 +0000
commitc854d190fdc2045e84c2cc52126b9e1cb35d7d98 (patch)
tree04228c96779e164ca4cd687dcc995041cf81e739 /auth-pam.c
parentdd7a92ba691271a7dac0e45a621679fd07340c4e (diff)
downloadopenssh-c854d190fdc2045e84c2cc52126b9e1cb35d7d98.tar.gz
- (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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 9ca18e77..970ff61c 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -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",