Don't put truncated hostnames in utmp

Approved by: jkh
This commit is contained in:
Brian Somers 2000-02-28 18:51:30 +00:00
parent 62585e33b0
commit ccd16b43ed

View File

@ -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;