[2860] in Kerberos-V5-bugs
pty/531: libpty behavior on BSD systems
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Tue Jan 20 14:29:40 1998
Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: hartmans@MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, ghudson@MIT.EDU
Date: Tue, 20 Jan 1998 14:28:16 -0500
From: ghudson@MIT.EDU
Reply-To: ghudson@MIT.EDU
To: krb5-bugs@MIT.EDU
>Number: 531
>Category: pty
>Synopsis: libpty writes out LOGIN_PROCESS utmp entries on BSD systems
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: hartmans
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Tue Jan 20 14:29:01 EST 1998
>Last-Modified:
>Originator: Greg Hudson
>Organization:
MIT
>Release: 1.0
>Environment:
System: SunOS small-gods 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-1
Architecture: sun4
>Description:
telnetd and rlogind write out utmp entries on System V systems, which is
appropriate. On BSD systems, however, it is not appropriate. krlogind
protects the pty_update_utmp() invocation with an #ifndef NO_UT_PID, but
the application is the wrong place to be making that decision. At any
rate, telnetd does not protect its invocation, so it does the wrong thing
on BSD.
>How-To-Repeat:
Connect to a krb5 telnetd on a BSD system and log in. Then run "last".
>Fix:
This patch makes libpty treat PTY_LOGIN_PROCESS requests as no-ops on
systems with NO_UT_PID. You can clean up krlogind.c a bit after
applying this patch (by taking out the #ifndef NO_UT_PID).
Index: update_utmp.c
===================================================================
RCS file: /afs/dev.mit.edu/source/repository/third/krb5/src/util/pty/update_utmp.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 update_utmp.c
*** update_utmp.c 1997/01/21 09:35:39 1.1.1.2
--- update_utmp.c 1998/01/20 19:13:42
***************
*** 55,61 ****
strncpy(ent.ut_line, line+sizeof("/dev/")-1, sizeof(ent.ut_line));
ent.ut_time = time(0);
! #ifndef NO_UT_PID
ent.ut_pid = pid;
switch ( process_type ) {
case PTY_LOGIN_PROCESS:
--- 55,64 ----
strncpy(ent.ut_line, line+sizeof("/dev/")-1, sizeof(ent.ut_line));
ent.ut_time = time(0);
! #ifdef NO_UT_PID
! if (process_type == PTY_LOGIN_PROCESS)
! return 0;
! #else /* NO_UT_PID */
ent.ut_pid = pid;
switch ( process_type ) {
case PTY_LOGIN_PROCESS:
>Audit-Trail:
>Unformatted: