Skip Menu |
 

Download (untitled) / with headers
text/plain 2.8KiB
From ghudson@MIT.EDU Tue Jan 20 14:28:20 1998
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id OAA19421 for <bugs@RT-11.MIT.EDU>; Tue, 20 Jan 1998 14:28:20 -0500
Received: from SMALL-GODS.MIT.EDU by MIT.EDU with SMTP
id AA01174; Tue, 20 Jan 98 14:28:18 EST
Received: by small-gods.MIT.EDU (SMI-8.6/4.7) id OAA10269; Tue, 20 Jan 1998 14:28:16 -0500
Message-Id: <199801201928.OAA10269@small-gods.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
Subject: libpty behavior on BSD systems
X-Send-Pr-Version: 3.99

Show quoted text
>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: closed
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Tue Jan 20 14:29:01 EST 1998
>Last-Modified: Thu Mar 12 18:14:22 EST 1998
>Originator: Greg Hudson
>Organization:
MIT
Show quoted text
>Release: 1.0
>Environment:

System: SunOS small-gods 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-1
Architecture: sun4

Show quoted text
>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.
Show quoted text
>How-To-Repeat:
Connect to a krb5 telnetd on a BSD system and log in. Then run "last".
Show quoted text
>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:
Show quoted text
>Audit-Trail:

State-Changed-From-To: open-closed
State-Changed-By: tlyu
State-Changed-When: Thu Mar 12 18:13:49 1998
State-Changed-Why:

Fixed. Thanks for the patch.

src/util/pty/update_wtmp.c 1.16

Show quoted text
>Unformatted: