diff options
Diffstat (limited to 'login.c')
-rw-r--r-- | login.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |