summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-03-22 11:58:15 +1100
committerDamien Miller <djm@mindrot.org>2001-03-22 11:58:15 +1100
commitbebd8be67bd8fc8e832faf0ed635f9e8a46ca126 (patch)
tree6e7604355d4567bb677377311966a90ce7563abb /session.c
parentb69407dd7ada7f0c254fc538da8357e36a1edb7a (diff)
- (djm) Better AIX no tty fix, spotted by Gert Doering <gert@greenie.muc.de>
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 bed03c746..a794f3b2d 100644
--- a/session.c
+++ b/session.c
@@ -1134,11 +1134,12 @@ do_child(Session *s, const char *command)
1134 * other stuff is stored - a few applications 1134 * other stuff is stored - a few applications
1135 * actually use this and die if it's not set 1135 * actually use this and die if it's not set
1136 */ 1136 */
1137 if (s->ttyfd == -1)
1138 s->tty[0] = '\0';
1137 cp = xmalloc(22 + strlen(s->tty) + 1139 cp = xmalloc(22 + strlen(s->tty) +
1138 2 * strlen(pw->pw_name)); 1140 2 * strlen(pw->pw_name));
1139 i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", 1141 i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c",
1140 pw->pw_name, 0, pw->pw_name, 0, 1142 pw->pw_name, 0, pw->pw_name, 0, s->tty, 0, 0);
1141 s->ttyfd == -1 ? "" : s->tty, 0,0);
1142 if (usrinfo(SETUINFO, cp, i) == -1) 1143 if (usrinfo(SETUINFO, cp, i) == -1)
1143 fatal("Couldn't set usrinfo: %s", 1144 fatal("Couldn't set usrinfo: %s",
1144 strerror(errno)); 1145 strerror(errno));