kern.pts.enable=1 forces tcsh autologout

From: Kris Kennaway <kris_at_obsecurity.org>
Date: Tue, 14 Nov 2006 23:10:21 -0500
When kern.pts.enable=1, the ptys are named /dev/pts/<n>, and tcsh
doesn't correctly recognize that it's a pty and it should disable
autologout.  Actually it does seem to have some code but it seems to
be incorrect:

    if (loginsh || (uid == 0)) {
        if (*cp) {
            /* only for login shells or root and we must have a tty */
            if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) {
                cp = cp2 + 1;
            }
            else
                cp2 = cp;
            if (!(((Strncmp(cp2, STRtty, 3) == 0) && Isalpha(cp2[3])) ||
                  ((Strncmp(cp, STRpts, 3) == 0) && cp[3] == '/'))) {
                if (getenv("DISPLAY") == NULL) {
                    /* NOT on X window shells */
                    set(STRautologout, Strsave(STRdefautologout),
                        VAR_READWRITE);
                }
            }
        }
    }

Kris

Received on Wed Nov 15 2006 - 03:10:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:02 UTC