If a host would exceed 16 characters in the utmp entry, record only

it's IP address/base host instead.

Submitted by:	brian
This commit is contained in:
Brian Feldman 2001-05-15 01:50:40 +00:00
parent 8d904f1537
commit 62c931e0a4

View File

@ -99,7 +99,7 @@ record_login(pid_t 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);
login(&u);
lastlog = _PATH_LASTLOG;