diff options
| author | Brian Somers <brian@FreeBSD.org> | 1999-04-06 23:06:00 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 1999-04-06 23:06:00 +0000 |
| commit | 32af26a50132167c86aa90413bade77884184c9e (patch) | |
| tree | 334abe3472979b7ccd4ff27f55f4041b862cf9e3 /libexec/rexecd | |
| parent | 595f220e045c18ca1604d6bf293763b5e71f6c0b (diff) | |
Notes
Diffstat (limited to 'libexec/rexecd')
| -rw-r--r-- | libexec/rexecd/rexecd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index ac7dca9b18fb..740368f323dd 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$"; + "$Id: rexecd.c,v 1.15 1997/11/26 07:29:04 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -55,6 +55,7 @@ static const char rcsid[] = #include <err.h> #include <netdb.h> +#include <libutil.h> #include <paths.h> #include <pwd.h> #include <signal.h> @@ -72,7 +73,7 @@ char path[sizeof(_PATH_DEFPATH) + sizeof("PATH=")] = "PATH="; char *envinit[] = {homedir, shell, path, username, 0}; char **environ; -char *remote; +char remote[MAXHOSTNAMELEN + 1]; struct sockaddr_in asin = { AF_INET }; @@ -103,10 +104,7 @@ main(argc, argv) if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) err(1, "getpeername"); - hp = gethostbyaddr((char *) &from.sin_addr, sizeof(from.sin_addr), - from.sin_family); - remote = inet_ntoa(from.sin_addr); - remote = (hp != NULL) ? hp->h_name : inet_ntoa(from.sin_addr); + realhostname(remote, sizeof remote - 1, &from.sin_addr); doit(0, &from); return(0); |
