aboutsummaryrefslogtreecommitdiff
path: root/libexec/rlogind
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-04-07 08:27:45 +0000
committerBrian Somers <brian@FreeBSD.org>1999-04-07 08:27:45 +0000
commit9e9a43bdec3ff0ad37e4799b209e0d9513150a6f (patch)
treefb3cb78777ecc17ab82d96b7153224fd483b2d4c /libexec/rlogind
parent5b3f0a74e15f741303eb4c823555de3464f8ef7c (diff)
downloadsrc-9e9a43bdec3ff0ad37e4799b209e0d9513150a6f.tar.gz
src-9e9a43bdec3ff0ad37e4799b209e0d9513150a6f.zip
Ensure that things returned by gethostname() and
friends are terminated and allow for a maximum host name length of MAXHOSTNAMELEN - 1. Put parenthesis around sizeof args. Make some variables static. Fix telnetd -u (broken by my last commit) Prompted by: bde
Notes
Notes: svn path=/head/; revision=45422
Diffstat (limited to 'libexec/rlogind')
-rw-r--r--libexec/rlogind/rlogind.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index a7cdba54a6cd..9974ed6277e2 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: rlogind.c,v 1.20 1998/12/16 07:20:44 peter Exp $";
+ "$Id: rlogind.c,v 1.21 1999/04/06 23:05:58 brian Exp $";
#endif /* not lint */
/*
@@ -211,7 +211,7 @@ doit(f, fromp)
{
int master, pid, on = 1;
int authenticated = 0;
- char hostname[2 * MAXHOSTNAMELEN + 1];
+ char hostname[MAXHOSTNAMELEN];
char c;
alarm(60);
@@ -226,7 +226,7 @@ doit(f, fromp)
alarm(0);
fromp->sin_port = ntohs((u_short)fromp->sin_port);
- realhostname(hostname, sizeof hostname - 1, &fromp->sin_addr);
+ realhostname(hostname, sizeof(hostname) - 1, &fromp->sin_addr);
hostname[sizeof(hostname) - 1] = '\0';
#ifdef KERBEROS