diff options
author | Damien Miller <djm@mindrot.org> | 2001-03-22 11:58:15 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-03-22 11:58:15 +1100 |
commit | bebd8be67bd8fc8e832faf0ed635f9e8a46ca126 (patch) | |
tree | 6e7604355d4567bb677377311966a90ce7563abb /session.c | |
parent | b69407dd7ada7f0c254fc538da8357e36a1edb7a (diff) |
- (djm) Better AIX no tty fix, spotted by Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)); |