On Wed, 21 Mar 2001, Mike Battersby wrote:
> The recent patch posted by Steve VanDevender <stevev at
darkwing.uoregon.edu>
> for fixing the session code on Tru64 isn't quite right -- it still
fails
> in the case of NO tty being allocated.
>
> The problem is that s->tty is a char[TTYSZ] rather than a char *, and
> hence can't hold a NULL. Calling sia_ses_init() with the tty being an
> empty string doesn't signify no tty, and hence will cause a failure.
The
> "no tty" case should have tty passed as NULL.
Thanks for spotting this. The following takes care of the SIA case.
I am pretty sure it fixes AIX as well, but the manpage that Gert sent to
the list was a little ambiguous - only saying that TTY should be
"null"
in the cases where no tty is present. Perhaps an AIX guru could enlighten
us here?
Index: session.c
==================================================================RCS file:
/var/cvs/openssh/session.c,v
retrieving revision 1.93
diff -u -r1.93 session.c
--- session.c 2001/03/21 00:11:57 1.93
+++ session.c 2001/03/21 05:10:07
@@ -1053,7 +1053,7 @@
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 @@
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));
--
| Damien Miller <djm at mindrot.org> \ ``E-mail attachments are the poor
man's
| http://www.mindrot.org / distributed filesystem'' - Dan
Geer