summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-03-21 16:13:16 +1100
committerDamien Miller <djm@mindrot.org>2001-03-21 16:13:16 +1100
commit672670ed5e1e643dfe7c606017183c5c3d9bed09 (patch)
tree1042ef133368244dd18b807713094d768e756beb
parenta19760fd5e6a1fe8e47907672fcaf48854f5e05f (diff)
- (djm) Correctly handle SIA and AIX when no tty present. Spotted and
suggested fix from Mike Battersby <mib@unimelb.edu.au>
-rw-r--r--ChangeLog4
-rw-r--r--session.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a4279671..247ff93b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
- (djm) Don't loop forever when changing password via PAM. Patch
from Solar Designer <solar@openwall.com>
- (djm) Generate config files before build
+ - (djm) Correctly handle SIA and AIX when no tty present. Spotted and
+ suggested fix from Mike Battersby <mib@unimelb.edu.au>
20010320
- (bal) glob.c update to added GLOB_LIMITS (OpenBSD CVS).
@@ -4654,4 +4656,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.991.2.3 2001/03/21 02:12:12 djm Exp $
+$Id: ChangeLog,v 1.991.2.4 2001/03/21 05:13:16 djm Exp $
diff --git a/session.c b/session.c
index 31a16dc7..bed03c74 100644
--- a/session.c
+++ b/session.c
@@ -1053,7 +1053,7 @@ do_child(Session *s, const char *command)
switch, so we let login(1) to this for us. */
if (!options.use_login) {
#ifdef HAVE_OSF_SIA
- session_setup_sia(pw->pw_name, s->tty);
+ session_setup_sia(pw->pw_name, s->ttyfd == -1 ? NULL : s->tty);
#else /* HAVE_OSF_SIA */
#ifdef HAVE_CYGWIN
if (is_winnt) {
@@ -1137,7 +1137,8 @@ do_child(Session *s, const char *command)
cp = xmalloc(22 + strlen(s->tty) +
2 * strlen(pw->pw_name));
i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c",
- pw->pw_name, 0, pw->pw_name, 0, s->tty, 0,0);
+ pw->pw_name, 0, pw->pw_name, 0,
+ s->ttyfd == -1 ? "" : s->tty, 0,0);
if (usrinfo(SETUINFO, cp, i) == -1)
fatal("Couldn't set usrinfo: %s",
strerror(errno));