diff options
author | brian <brian@FreeBSD.org> | 1999-04-07 08:27:45 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-04-07 08:27:45 +0000 |
commit | c6c6c7de65eae103002ebb9bee8881e1e2e903df (patch) | |
tree | 18fb09ba4ed57096b2a23fd9d28689784a00024b /libexec/rexecd | |
parent | 32ff8071a15df941cbe4d98c0badea284464f320 (diff) | |
download | FreeBSD-src-c6c6c7de65eae103002ebb9bee8881e1e2e903df.zip FreeBSD-src-c6c6c7de65eae103002ebb9bee8881e1e2e903df.tar.gz |
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
Diffstat (limited to 'libexec/rexecd')
-rw-r--r-- | libexec/rexecd/rexecd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index 740368f..8c8c06b 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)rexecd.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id: rexecd.c,v 1.15 1997/11/26 07:29:04 charnier Exp $"; + "$Id: rexecd.c,v 1.16 1999/04/06 23:05:57 brian Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -73,7 +73,7 @@ char path[sizeof(_PATH_DEFPATH) + sizeof("PATH=")] = "PATH="; char *envinit[] = {homedir, shell, path, username, 0}; char **environ; -char remote[MAXHOSTNAMELEN + 1]; +char remote[MAXHOSTNAMELEN]; struct sockaddr_in asin = { AF_INET }; @@ -104,7 +104,7 @@ main(argc, argv) if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) err(1, "getpeername"); - realhostname(remote, sizeof remote - 1, &from.sin_addr); + realhostname(remote, sizeof(remote) - 1, &from.sin_addr); doit(0, &from); return(0); |