Don't put truncated hostnames in utmp

Approved by: jkh
This commit is contained in:
brian 2000-02-28 18:51:30 +00:00
parent ce0f910200
commit 499e159c08

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;