diff options
Diffstat (limited to 'libexec/uucpd/uucpd.c')
-rw-r--r-- | libexec/uucpd/uucpd.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c index 59a69320b022..e15c05b3bea2 100644 --- a/libexec/uucpd/uucpd.c +++ b/libexec/uucpd/uucpd.c @@ -45,7 +45,7 @@ static const char copyright[] = static char sccsid[] = "@(#)uucpd.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id: uucpd.c,v 1.15 1998/06/30 15:19:51 bde Exp $"; + "$Id: uucpd.c,v 1.16 1999/03/30 10:23:35 joerg Exp $"; #endif /* not lint */ /* @@ -121,16 +121,8 @@ void main(int argc, char **argv) void badlogin(char *name, struct sockaddr_in *sin) { char remotehost[MAXHOSTNAMELEN]; - struct hostent *hp = gethostbyaddr((char *)&sin->sin_addr, - sizeof (struct in_addr), AF_INET); - - if (hp) { - strncpy(remotehost, hp->h_name, sizeof (remotehost)); - endhostent(); - } else - strncpy(remotehost, inet_ntoa(sin->sin_addr), - sizeof (remotehost)); + realhostname(remotehost, sizeof remotehost - 1, &sin->sin_addr); remotehost[sizeof remotehost - 1] = '\0'; syslog(LOG_NOTICE, "LOGIN FAILURE FROM %s", remotehost); @@ -251,19 +243,13 @@ void dologout(void) void dologin(struct passwd *pw, struct sockaddr_in *sin) { char line[32]; - char remotehost[MAXHOSTNAMELEN]; + char remotehost[UT_HOSTSIZE + 1]; int f; time_t cur_time; - struct hostent *hp = gethostbyaddr((char *)&sin->sin_addr, - sizeof (struct in_addr), AF_INET); - if (hp) { - strncpy(remotehost, hp->h_name, sizeof (remotehost)); - endhostent(); - } else - strncpy(remotehost, inet_ntoa(sin->sin_addr), - sizeof (remotehost)); + realhostname(remotehost, sizeof remotehost - 1, &sin->sin_addr); remotehost[sizeof remotehost - 1] = '\0'; + /* hack, but must be unique and no tty line */ sprintf(line, "uucp%ld", (long)getpid()); time(&cur_time); |