Tru64 UNIX SIA in 2.5.2p1 is hosed (still)

Mike Battersby mib at unimelb.edu.au
Wed Mar 21 15:51:18 EST 2001


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.

One possible fix for this is to change the call to sia_ses_init from:

        if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0,
            NULL) != SIASUCCESS)
to:
        if (sia_ses_init(&ent, saved_argc, saved_argv, host, user,
            tty[0] ? tty : NULL, 0, NULL) != SIASUCCESS)

However, I'm not convinced that tty won't be some random value here if 
session structure has been used before, since s->tty isn't zeroed in
session_new().  Thus you may possibly also need to add:

	s->tty[0] = '\0';

into the session initialisation in session_new(), or maybe set it before
the call to do_child() in do_exec_no_pty().

On further thought, perhaps the call to sia_ses_init should be left alone 
and the call to session_setup_sia() in session.c changed from:

        session_setup_sia(pw->pw_name, s->tty);
to:
        session_setup_sia(pw->pw_name, s->ttyfd != -1 ? s->tty : NULL);

Can someone who knows the code better than I do shed some light on the
correct solution here.

 - Mike

-- 
Mike Battersby <mib at unimelb.edu.au>        The University of Melbourne
Fetch my pgp key from: http://ariel.ucs.unimelb.edu.au/~mib/pgpkey.txt


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 222 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20010321/149aff6c/attachment.bin 


More information about the openssh-unix-dev mailing list