summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-03-21 16:13:03 +1100
committerDamien Miller <djm@mindrot.org>2001-03-21 16:13:03 +1100
commitb69407dd7ada7f0c254fc538da8357e36a1edb7a (patch)
tree84766c9fffb5751bffcf6efc0615b23995e67a57 /session.c
parent4b4e2d31d66728b06a0a5defed21c2781e0f314a (diff)
- (djm) Correctly handle SIA and AIX when no tty present. Spotted and
suggested fix from Mike Battersby <mib@unimelb.edu.au>
Diffstat (limited to 'session.c')
-rw-r--r--session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/session.c b/session.c
index 31a16dc7c..bed03c746 100644
--- a/session.c
+++ b/session.c
@@ -1053,7 +1053,7 @@ do_child(Session *s, const char *command)
1053 switch, so we let login(1) to this for us. */ 1053 switch, so we let login(1) to this for us. */
1054 if (!options.use_login) { 1054 if (!options.use_login) {
1055#ifdef HAVE_OSF_SIA 1055#ifdef HAVE_OSF_SIA
1056 session_setup_sia(pw->pw_name, s->tty); 1056 session_setup_sia(pw->pw_name, s->ttyfd == -1 ? NULL : s->tty);
1057#else /* HAVE_OSF_SIA */ 1057#else /* HAVE_OSF_SIA */
1058#ifdef HAVE_CYGWIN 1058#ifdef HAVE_CYGWIN
1059 if (is_winnt) { 1059 if (is_winnt) {
@@ -1137,7 +1137,8 @@ do_child(Session *s, const char *command)
1137 cp = xmalloc(22 + strlen(s->tty) + 1137 cp = xmalloc(22 + strlen(s->tty) +
1138 2 * strlen(pw->pw_name)); 1138 2 * strlen(pw->pw_name));
1139 i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", 1139 i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c",
1140 pw->pw_name, 0, pw->pw_name, 0, s->tty, 0,0); 1140 pw->pw_name, 0, pw->pw_name, 0,
1141 s->ttyfd == -1 ? "" : s->tty, 0,0);
1141 if (usrinfo(SETUINFO, cp, i) == -1) 1142 if (usrinfo(SETUINFO, cp, i) == -1)
1142 fatal("Couldn't set usrinfo: %s", 1143 fatal("Couldn't set usrinfo: %s",
1143 strerror(errno)); 1144 strerror(errno));