mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
Block SIGHUP during call to gethostbyaddr().
PR: 5548 Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Obtained from: OpenBSD
This commit is contained in:
parent
240d6d79b1
commit
65f14c0055
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42114
@ -42,7 +42,7 @@ static const char copyright[] =
|
||||
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: syslogd.c,v 1.42 1998/11/05 10:51:21 dg Exp $";
|
||||
"$Id: syslogd.c,v 1.43 1998/12/04 06:49:20 jkh Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -1066,6 +1066,7 @@ cvthname(f)
|
||||
struct sockaddr_in *f;
|
||||
{
|
||||
struct hostent *hp;
|
||||
sigset_t omask, nmask;
|
||||
char *p;
|
||||
|
||||
dprintf("cvthname(%s)\n", inet_ntoa(f->sin_addr));
|
||||
@ -1074,8 +1075,12 @@ cvthname(f)
|
||||
dprintf("Malformed from address\n");
|
||||
return ("???");
|
||||
}
|
||||
sigemptyset(&nmask);
|
||||
sigaddset(&nmask, SIGHUP);
|
||||
sigprocmask(SIG_BLOCK, &nmask, &omask);
|
||||
hp = gethostbyaddr((char *)&f->sin_addr,
|
||||
sizeof(struct in_addr), f->sin_family);
|
||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||
if (hp == 0) {
|
||||
dprintf("Host name for your address (%s) unknown\n",
|
||||
inet_ntoa(f->sin_addr));
|
||||
|
Loading…
Reference in New Issue
Block a user