diff options
author | Damien Miller <djm@mindrot.org> | 1999-12-27 11:33:56 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-12-27 11:33:56 +1100 |
commit | e12762437cba818ba9e05fe4eed90a39c0ef887b (patch) | |
tree | 66e04a25eb615c27425909990189e8c4edb5407b | |
parent | 438dfa9dea6a08e80549cf6110a0d159500f168a (diff) |
- Use last few chars of tty line as ut_id
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | login.c | 4 |
2 files changed, 4 insertions, 1 deletions
@@ -7,6 +7,7 @@ | |||
7 | - PAM bugfix. PermitEmptyPassword was being ignored. | 7 | - PAM bugfix. PermitEmptyPassword was being ignored. |
8 | - Fixed PAM config files to allow empty passwords if server does. | 8 | - Fixed PAM config files to allow empty passwords if server does. |
9 | - Explained spurious PAM auth warning workaround in UPGRADING | 9 | - Explained spurious PAM auth warning workaround in UPGRADING |
10 | - Use last few chars of tty line as ut_id | ||
10 | 11 | ||
11 | 19991226 | 12 | 19991226 |
12 | - Enabled utmpx support by default for Solaris | 13 | - Enabled utmpx support by default for Solaris |
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "includes.h" | 20 | #include "includes.h" |
21 | RCSID("$Id: login.c,v 1.12 1999/12/25 23:21:48 damien Exp $"); | 21 | RCSID("$Id: login.c,v 1.13 1999/12/27 00:33:56 damien Exp $"); |
22 | 22 | ||
23 | #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) | 23 | #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) |
24 | # include <utmpx.h> | 24 | # include <utmpx.h> |
@@ -141,6 +141,7 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid, | |||
141 | /* Construct an utmp/wtmp entry. */ | 141 | /* Construct an utmp/wtmp entry. */ |
142 | memset(&u, 0, sizeof(u)); | 142 | memset(&u, 0, sizeof(u)); |
143 | strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line)); | 143 | strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line)); |
144 | strncpy(u.ut_id, ttyname + 8, sizeof(u.ut_id)); | ||
144 | u.ut_pid = (pid_t)pid; | 145 | u.ut_pid = (pid_t)pid; |
145 | u.ut_time = time(NULL); | 146 | u.ut_time = time(NULL); |
146 | strncpy(u.ut_name, user, sizeof(u.ut_name)); | 147 | 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, | |||
153 | memset(&utx, 0, sizeof(utx)); | 154 | memset(&utx, 0, sizeof(utx)); |
154 | strncpy(utx.ut_user, user, sizeof(utx.ut_name)); | 155 | strncpy(utx.ut_user, user, sizeof(utx.ut_name)); |
155 | strncpy(utx.ut_line, ttyname + 5, sizeof(utx.ut_line)); | 156 | strncpy(utx.ut_line, ttyname + 5, sizeof(utx.ut_line)); |
157 | strncpy(utx.ut_id, ttyname + 8, sizeof(utx.ut_id)); | ||
156 | utx.ut_pid = (pid_t)pid; | 158 | utx.ut_pid = (pid_t)pid; |
157 | utx.ut_tv.tv_sec = time(NULL); | 159 | utx.ut_tv.tv_sec = time(NULL); |
158 | utx.ut_type = (uid == -1)?DEAD_PROCESS:USER_PROCESS; | 160 | utx.ut_type = (uid == -1)?DEAD_PROCESS:USER_PROCESS; |