summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-27 11:33:56 +1100
committerDamien Miller <djm@mindrot.org>1999-12-27 11:33:56 +1100
commite12762437cba818ba9e05fe4eed90a39c0ef887b (patch)
tree66e04a25eb615c27425909990189e8c4edb5407b
parent438dfa9dea6a08e80549cf6110a0d159500f168a (diff)
- Use last few chars of tty line as ut_id
-rw-r--r--ChangeLog1
-rw-r--r--login.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 575b8b17..42a3e3f4 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 f4e6ddfa..f03db053 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 <utmpx.h>
@@ -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;