Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 53977

Summary: Openssh server utmp handling with large pts values (ut_line size is 7+ chars)
Product: Gentoo Linux Reporter: Antanas Kompanas <antas>
Component: [OLD] ServerAssignee: Daniel Ahlberg (RETIRED) <aliz>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: line name buffer size fix

Description Antanas Kompanas 2004-06-15 07:47:22 UTC
Since kernel 2.6.? pts numbers are allocated sequncially instead of first free. This way it is easy for pts numbers to go as high as 1000 and up. This makes a short pts names (e.g. "pts/1000") 8 chars long. In syslogin_preform_logout() function of openssh (loginrec.c) a variable of length 8 is allocated to hold ut_line value and thus long pts lines get truncated resulting in "login() returned error result" errors and /var/run/utmp filled with stale records.

It appears that in openssh-3.8.1_p1-r1 this bug is fixed. Unfortunately it is marked unstable. Additionally, many users may be still using openssh-3.7.1_p2-r2.

The patch that I will attach is one-liner that fixes this issue and applies to both openssh-3.8_p1 and openssh-3.7.1 which both have ebuilds currently marked as stable.

As an alternative, any of openssh-3.8.1 could be marked as stable (if it is).
Comment 1 Antanas Kompanas 2004-06-15 07:52:54 UTC
Created attachment 33312 [details, diff]
line name buffer size fix

This is the patch described earlier. It ports the fix to line size buffer
available in 3.8.1p1 to 3.8p1 and 3.7.1p2.
Comment 2 Daniel Ahlberg (RETIRED) gentoo-dev 2004-08-05 17:38:23 UTC
Most arches is marked stable for >=3.8.1.
Comment 3 Antanas Kompanas 2004-08-05 23:46:50 UTC
Now they are, of course.