Don't put truncated hostnames in utmp
Approved by: jkh
This commit is contained in:
parent
ce0f910200
commit
499e159c08
@ -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