diff options
| author | Sam Hartman <hartmans@mit.edu> | 1996-01-16 19:40:56 +0000 |
|---|---|---|
| committer | Sam Hartman <hartmans@mit.edu> | 1996-01-16 19:40:56 +0000 |
| commit | 6e8dafda2b160adcadeb2918a35a4f4df2ab6528 (patch) | |
| tree | d66502e4a632437649655b49c7706a27f9067da5 /src/util | |
| parent | 6a43ea4aed5c8834372fa40ce89d7d1ddfa1fe6d (diff) | |
| download | krb5-6e8dafda2b160adcadeb2918a35a4f4df2ab6528.tar.gz krb5-6e8dafda2b160adcadeb2918a35a4f4df2ab6528.tar.xz krb5-6e8dafda2b160adcadeb2918a35a4f4df2ab6528.zip | |
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
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/pty/logwtmp.c | 2 | ||||
| -rw-r--r-- | src/util/pty/pty-int.h | 2 | ||||
| -rw-r--r-- | 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 |
