bugzilla-daemon at mindrot.org
2004-Apr-28  23:16 UTC
[Bug 855] doesn't properly log logout event in utmp entry when pts bigger than 999
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.
bugzilla-daemon at mindrot.org
2004-Apr-28  23:20 UTC
[Bug 855] doesn't properly log logout event in utmp entry when pts bigger than 999
http://bugzilla.mindrot.org/show_bug.cgi?id=855
dtucker at zip.com.au changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
------- Additional Comments From dtucker at zip.com.au  2004-04-29 09:20 -------
Already fixed in 3.8.1p1.
20040408
 - (dtucker) [loginrec.c] Use UT_LINESIZE if available, prevents truncating
   pty name on Linux 2.6.x systems.  Patch from jpe at eisenmenger.org.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.