summaryrefslogtreecommitdiffstats
path: root/libexec/telnetd
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-04-26 22:33:15 +0000
committerache <ache@FreeBSD.org>1995-04-26 22:33:15 +0000
commite028135d855b37f7aacad442c7edbdbed78513c9 (patch)
tree9e6fb936d9558b14a5552529dd34ff3c0218a5ae /libexec/telnetd
parentdeaecc49c4cf8164628ba1fdc6bb4d797ea811d3 (diff)
downloadFreeBSD-src-e028135d855b37f7aacad442c7edbdbed78513c9.zip
FreeBSD-src-e028135d855b37f7aacad442c7edbdbed78513c9.tar.gz
Fix bug:
When hostname len > 8, name replaced with dot notation when -u flag not specified (default case). Use _PATH_* for utmp/wtmp.
Diffstat (limited to 'libexec/telnetd')
-rw-r--r--libexec/telnetd/sys_term.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index 17b9606..786661c 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 <initreq.h>
-int utmp_len = MAXHOSTNAMELEN; /* sizeof(init_request.host) */
#else /* NEWINIT*/
# ifdef UTMPX
# include <utmpx.h>
@@ -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 */
OpenPOWER on IntegriCloud