line_abbrevname patch

Michael Stone mstone at cs.loyola.edu
Thu Sep 6 22:16:52 EST 2001


Once upon a time there were two places in the loginrec code that were
ifdef'd sgi and which stripped the "tty" off the line along with the
"dev" when recording utmp. (Specifically it was being done in
line_stripname and line_abbrevname.) Doing that in line_stripname was
wrong, because it broke things like wall that expected the ut_line to
have the "tty" present. But I lost track of patches and also sent a
patch to get it removed from line_abbrevname (which breaks
interoperability with native xterms and other things that use pty's, as
they use a ut_id which does *not* have the "tty", so you end up with a
utmp that has multiple entries for each tty.) In thinking about putting
it back it, it occurred to me that irix might not be the only platform
to do use a ut_id of this form. So instead of making it ifdef sgi I made
it a configure option. If the powers that be think this is more ugly
rather than less ugly, the erroneous removal from line_abbrevname was
between 2.5.1p1 and 2.5.1p2; I don't see a changelog entry relating to
the removal of the ifdef sgi from line_stripname, so I don't know when
that was done (although I know it was before 2.5.1p1.)

--- openssh-2.9p2.orig/config.h.in      Sun Jun 17 04:09:47 2001
+++ openssh-2.9p2/config.h.in   Wed Sep  5 19:11:41 2001
@@ -102,6 +102,9 @@
 /* Define if you want IRIX kernel jobs */
 #undef WITH_IRIX_JOBS

+/* Define if the tty id (abbreviated name) in *tmp strips tty */
+#undef WITH_NO_TTY_IN_UTMP_ID
+
 /* Location of random number pool  */
 #undef RANDOM_POOL

--- openssh-2.9p2.orig/configure.in     Mon May 28 17:21:44 2001
+++ openssh-2.9p2/configure.in  Wed Sep  5 19:13:06 2001
@@ -111,6 +111,7 @@
        AC_DEFINE(WITH_IRIX_ARRAY)
        AC_DEFINE(WITH_IRIX_PROJECT)
        AC_DEFINE(WITH_IRIX_AUDIT)
+       AC_DEFINE(WITH_NO_TTY_IN_UTMP_ID)
        AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
        no_libsocket=1
        no_libnsl=1
--- openssh-2.9p2.orig/loginrec.c       Tue May  8 20:34:33 2001
+++ openssh-2.9p2/loginrec.c    Wed Sep  5 19:09:00 2001
@@ -563,6 +563,11 @@
        if (strncmp(src, "/dev/", 5) == 0)
                src += 5;

+#ifdef WITH_NO_TTY_IN_UTMP_ID
+       if (strncmp(src, "tty", 3) == 0)
+               src += 3;
+#endif
+
        len = strlen(src);

        if (len > 0) {


-- 
Mike Stone



More information about the openssh-unix-dev mailing list