diff options
author | brian <brian@FreeBSD.org> | 1999-04-08 21:39:34 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-04-08 21:39:34 +0000 |
commit | 7670f1eab4547f1cca0d18d7f37c0b67dc603fbb (patch) | |
tree | 1599aa913574bbb53871ef874c4e8167aefb5e2b /contrib/telnet | |
parent | ee8f7b8bf011298bd73ef15bed2adf767d4c6cce (diff) | |
download | FreeBSD-src-7670f1eab4547f1cca0d18d7f37c0b67dc603fbb.zip FreeBSD-src-7670f1eab4547f1cca0d18d7f37c0b67dc603fbb.tar.gz |
MF libexec/telnetd: Determine the host name using an array size of
MAXHOSTNAMELEN and call trimdomain() before implementing
the -u option.
Diffstat (limited to 'contrib/telnet')
-rw-r--r-- | contrib/telnet/telnetd/telnetd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c index 8b4798c..b522f19 100644 --- a/contrib/telnet/telnetd/telnetd.c +++ b/contrib/telnet/telnetd/telnetd.c @@ -42,7 +42,7 @@ static const char copyright[] = static const char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95"; #endif static const char rcsid[] = - "$Id: telnetd.c,v 1.7 1999/04/06 23:35:21 brian Exp $"; + "$Id: telnetd.c,v 1.8 1999/04/07 10:17:24 brian Exp $"; #endif /* not lint */ #include "telnetd.h" @@ -93,7 +93,7 @@ int auth_level = 0; int require_SecurID = 0; #endif -char remote_hostname[UT_HOSTSIZE + 1]; +char remote_hostname[MAXHOSTNAMELEN]; int utmp_len = sizeof(remote_hostname) - 1; int registerd_host_only = 0; @@ -871,6 +871,7 @@ doit(who) Please contact your net administrator"); remote_hostname[sizeof(remote_hostname) - 1] = '\0'; + trimdomain(remote_hostname, UT_HOSTSIZE); if (!isdigit(remote_hostname[0]) && strlen(remote_hostname) > utmp_len) strncpy(remote_hostname, inet_ntoa(who->sin_addr), sizeof(remote_hostname) - 1); |