[Bug 855] doesn't properly log logout event in utmp entry when pts bigger than 999

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Apr 29 09:16:48 EST 2004


http://bugzilla.mindrot.org/show_bug.cgi?id=855

           Summary: doesn't properly log logout event in utmp entry when pts
                    bigger than 999
           Product: Portable OpenSSH
           Version: 3.8p1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sshd
        AssignedTo: openssh-bugs at mindrot.org
        ReportedBy: arekm at pld-linux.org


The problem is:
syslogin_perform_logout() uses char line[8]; so tty name can have max 7 
characters which is not common on recent linux 2.6.5 (and higher) systems which 
do not use first free pts number (see http://testing.lkml.org/slashdot.php?
mid=465538 if you are really interested).

Due to that there are bad entries in utmp left like:
misiek   pts/1049     192.168.2.2      Thu Apr 29 01:11    gone - no logout
misiek   pts/1046     192.168.2.2      Thu Apr 29 01:05    gone - no logout
misiek   pts/1045     192.168.2.2      Thu Apr 29 01:05    gone - no logout
misiek   pts/1044     192.168.2.2      Thu Apr 29 01:04    gone - no logout


Patch to fix issue:
diff -urN openssh-3.8p1.org/loginrec.c openssh-3.8p1/loginrec.c
--- openssh-3.8p1.org/loginrec.c        2004-04-29 01:06:46.350105456 +0200
+++ openssh-3.8p1/loginrec.c    2004-04-29 01:07:37.357351176 +0200
@@ -1354,7 +1354,7 @@
 syslogin_perform_logout(struct logininfo *li)
 {
 # ifdef HAVE_LOGOUT
-       char line[8];
+       char line[LINFO_LINESIZE];

        (void)line_stripname(line, li->line, sizeof(line));



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list