summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-03-22 11:58:26 +1100
committerDamien Miller <djm@mindrot.org>2001-03-22 11:58:26 +1100
commit9761cb7a63e0cff493ac9ad200e29b3113c19896 (patch)
treec3fdc9594d2af83f89bcb94a16afb7b256f32106
parent672670ed5e1e643dfe7c606017183c5c3d9bed09 (diff)
- (djm) Better AIX no tty fix, spotted by Gert Doering <gert@greenie.muc.de>
-rw-r--r--ChangeLog5
-rw-r--r--session.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 247ff93b..179e0aab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+20010322
+ - (djm) Better AIX no tty fix, spotted by Gert Doering <gert@greenie.muc.de>
+
20010321
- (djm) Fix ttyname breakage for AIX and Tru64. Patch from Steve
VanDevender <stevev@darkwing.uoregon.edu>
@@ -4656,4 +4659,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.991.2.4 2001/03/21 05:13:16 djm Exp $
+$Id: ChangeLog,v 1.991.2.5 2001/03/22 00:58:26 djm Exp $
diff --git a/session.c b/session.c
index bed03c74..a794f3b2 100644
--- a/session.c
+++ b/session.c
@@ -1134,11 +1134,12 @@ do_child(Session *s, const char *command)
* other stuff is stored - a few applications
* actually use this and die if it's not set
*/
+ if (s->ttyfd == -1)
+ s->tty[0] = '\0';
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->ttyfd == -1 ? "" : s->tty, 0,0);
+ pw->pw_name, 0, pw->pw_name, 0, s->tty, 0, 0);
if (usrinfo(SETUINFO, cp, i) == -1)
fatal("Couldn't set usrinfo: %s",
strerror(errno));