From e12762437cba818ba9e05fe4eed90a39c0ef887b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 27 Dec 1999 11:33:56 +1100 Subject: - Use last few chars of tty line as ut_id --- ChangeLog | 1 + login.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 575b8b17a..42a3e3f47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ - PAM bugfix. PermitEmptyPassword was being ignored. - Fixed PAM config files to allow empty passwords if server does. - Explained spurious PAM auth warning workaround in UPGRADING + - Use last few chars of tty line as ut_id 19991226 - Enabled utmpx support by default for Solaris diff --git a/login.c b/login.c index f4e6ddfaf..f03db0532 100644 --- a/login.c +++ b/login.c @@ -18,7 +18,7 @@ */ #include "includes.h" -RCSID("$Id: login.c,v 1.12 1999/12/25 23:21:48 damien Exp $"); +RCSID("$Id: login.c,v 1.13 1999/12/27 00:33:56 damien Exp $"); #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) # include @@ -141,6 +141,7 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid, /* Construct an utmp/wtmp entry. */ memset(&u, 0, sizeof(u)); strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line)); + strncpy(u.ut_id, ttyname + 8, sizeof(u.ut_id)); u.ut_pid = (pid_t)pid; u.ut_time = time(NULL); strncpy(u.ut_name, user, sizeof(u.ut_name)); @@ -153,6 +154,7 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid, memset(&utx, 0, sizeof(utx)); strncpy(utx.ut_user, user, sizeof(utx.ut_name)); strncpy(utx.ut_line, ttyname + 5, sizeof(utx.ut_line)); + strncpy(utx.ut_id, ttyname + 8, sizeof(utx.ut_id)); utx.ut_pid = (pid_t)pid; utx.ut_tv.tv_sec = time(NULL); utx.ut_type = (uid == -1)?DEAD_PROCESS:USER_PROCESS; -- cgit v1.2.3