Don't put truncated hostnames in utmp
Approved by: jkh
This commit is contained in:
parent
62585e33b0
commit
ccd16b43ed
@ -87,7 +87,7 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
|
||||
strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line));
|
||||
u.ut_time = time(NULL);
|
||||
strncpy(u.ut_name, user, sizeof(u.ut_name));
|
||||
strncpy(u.ut_host, host, sizeof(u.ut_host));
|
||||
realhostname_sa(u.ut_host, sizeof(u.ut_host), addr, addr->sa_len);
|
||||
|
||||
/* Figure out the file names. */
|
||||
utmp = _PATH_UTMP;
|
||||
|
Loading…
Reference in New Issue
Block a user