From 6e8dafda2b160adcadeb2918a35a4f4df2ab6528 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Tue, 16 Jan 1996 19:40:56 +0000 Subject: [PATCH] Fix handling so that the username is only written out to wtmpx logout records; I know of no systems that write out usernames in DEAD_PROCESS records in wtmp, but can special case them in update_wtmp if they are found. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7323 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/pty/logwtmp.c | 2 +- src/util/pty/pty-int.h | 2 +- src/util/pty/update_wtmp.c | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/util/pty/logwtmp.c b/src/util/pty/logwtmp.c index 89feabb81..4fbac3427 100644 --- a/src/util/pty/logwtmp.c +++ b/src/util/pty/logwtmp.c @@ -56,7 +56,7 @@ long pty_logwtmp (tty, user, host ) strncpy(ut.ut_name, user, sizeof(ut.ut_name)); #endif - return ptyint_update_wtmp(&ut, host); + return ptyint_update_wtmp(&ut, host, user); #endif /*HAVE_LOGWTMP*/ } diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h index 1b59275c5..489072654 100644 --- a/src/util/pty/pty-int.h +++ b/src/util/pty/pty-int.h @@ -94,7 +94,7 @@ void initialize_pty_error_table(void); long ptyint_void_association(void); long ptyint_open_ctty (char *slave, int *fd); -long ptyint_update_wtmp (struct utmp *ut, char *host); +long ptyint_update_wtmp (struct utmp *ut, char *host, char *user); void ptyint_vhangup(void); #else /*__STDC__*/ diff --git a/src/util/pty/update_wtmp.c b/src/util/pty/update_wtmp.c index 4666b44cc..0bda4dbac 100644 --- a/src/util/pty/update_wtmp.c +++ b/src/util/pty/update_wtmp.c @@ -32,9 +32,10 @@ #endif -long ptyint_update_wtmp (ent , host) +long ptyint_update_wtmp (ent , host, user) struct utmp *ent; char *host; +char *user; { struct utmp ut; struct stat statb; @@ -45,7 +46,9 @@ long ptyint_update_wtmp (ent , host) getutmpx(ent, &utx); if (host) strncpy(utx.ut_host, host, sizeof(utx.ut_host) ); - else utx.ut_host[0] = 0; +else utx.ut_host[0] = 0; +if (user) + strncpy(utx.ut_user, user, sizeof(utx.ut_user)); updwtmpx(WTMPX_FILE, &utx); #endif -- 2.26.2