Bug 66950

Summary: Disappearing utmp entries.
Product: [Retired] Red Hat Linux Beta Reporter: hjl
Component: util-linuxAssignee: Elliot Lee <sopwith>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: beta2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-06-19 00:00:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A patch none

Description hjl 2002-06-18 23:59:54 UTC
login.c has code


        /* If we can't find a pre-existing entry by pid, try by line.
           BSD network daemons may rely on this. (anonymous) */
        if (utp == NULL) {
             setutent();
             ut.ut_type = LOGIN_PROCESS;
             strncpy(ut.ut_id, tty_number, sizeof(ut.ut_id));
             strncpy(ut.ut_line, tty_name, sizeof(ut.ut_line));
             utp = getutid(&ut);
        }
        
The problem is getutid will seatch for entries with the matching
ut_id. However, it uses tty_number to match the ut_id. As the
result, if the second remote login will match the "1" entry in
/etc/inittab:

1:2345:respawn:/sbin/mingetty tty1

You can see that by logging on console and rlogin twice to the same
machine. You won't see the user on console with

# who

The fix is to use getutline instead of getutid.

Comment 1 hjl 2002-06-19 00:00:28 UTC
Created attachment 61507 [details]
A patch

Comment 2 Elliot Lee 2002-06-20 19:02:27 UTC
applied