From d3e6b9f3932f893fe33937e22ed66e46ae4ef037 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 26 Apr 1995 22:33:15 +0000 Subject: [PATCH] Fix bug: When hostname len > 8, name replaced with dot notation when -u flag not specified (default case). Use _PATH_* for utmp/wtmp. --- libexec/telnetd/sys_term.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 17b96065c90..786661c097b 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)sys_term.c 8.2 (Berkeley) 12/15/93"; # define PARENT_DOES_UTMP #endif +int utmp_len = MAXHOSTNAMELEN; #ifdef NEWINIT #include -int utmp_len = MAXHOSTNAMELEN; /* sizeof(init_request.host) */ #else /* NEWINIT*/ # ifdef UTMPX # include @@ -58,10 +58,17 @@ struct utmpx wtmp; struct utmp wtmp; # endif /* UTMPX */ -int utmp_len = sizeof(wtmp.ut_host); # ifndef PARENT_DOES_UTMP +#ifdef _PATH_WTMP +char wtmpf[] = _PATH_WTMP; +#else char wtmpf[] = "/usr/adm/wtmp"; +#endif +#ifdef _PATH_UTMP +char utmpf[] = _PATH_UTMP; +#else char utmpf[] = "/etc/utmp"; +#endif # else /* PARENT_DOES_UTMP */ char wtmpf[] = "/etc/wtmp"; # endif /* PARENT_DOES_UTMP */