diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-07-14 01:56:51 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-07-14 01:56:51 +0000 |
commit | 270b119bead6b79320271a8d9d65a644b05f24fc (patch) | |
tree | 4a8d55d1b0152c690dd23d63167d09acd7bc218a /gnu | |
parent | 7d556fc736c8df48fc645eae1d60840bf4e97735 (diff) | |
download | FreeBSD-src-270b119bead6b79320271a8d9d65a644b05f24fc.zip FreeBSD-src-270b119bead6b79320271a8d9d65a644b05f24fc.tar.gz |
server.c: When 'securenets' (actually TCP_WRAPPERS) is enabled, don't
syslog connections unless they were rejected. This helps save wear and
tear on the syslog facility in large networks with many clienst systems.
yp_svc.c: Be a little smarter about using sigaction() -- set the SA_RESTART
flag.
svc_run: Be doubly paranoid about killing off child processes. Do a flag
chack and a pid check before letting child 'threads' self-destruct.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.sbin/ypserv/server.c | 2 | ||||
-rw-r--r-- | gnu/usr.sbin/ypserv/svc_run.c | 6 | ||||
-rw-r--r-- | gnu/usr.sbin/ypserv/yp_svc.c | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/gnu/usr.sbin/ypserv/server.c b/gnu/usr.sbin/ypserv/server.c index 27b88e3..5b16cfd 100644 --- a/gnu/usr.sbin/ypserv/server.c +++ b/gnu/usr.sbin/ypserv/server.c @@ -152,7 +152,7 @@ static int is_valid_host(struct sockaddr_in *sin) inet_ntoa(sin->sin_addr), ""); - if (sin->sin_addr.s_addr != oldaddr || status != oldstatus ) { + if (!status && (sin->sin_addr.s_addr != oldaddr || status != oldstatus)) { syslog(status?allow_severity:deny_severity, "%sconnect from %s\n",status?"":"refused ", h?h:inet_ntoa(sin->sin_addr)); diff --git a/gnu/usr.sbin/ypserv/svc_run.c b/gnu/usr.sbin/ypserv/svc_run.c index 9b7357a..6f4a52c 100644 --- a/gnu/usr.sbin/ypserv/svc_run.c +++ b/gnu/usr.sbin/ypserv/svc_run.c @@ -55,6 +55,10 @@ my_svc_run() #endif /* def FD_SETSIZE */ extern int errno; extern int forked; + int pid; + + /* Establish the identity of the parent ypserv process. */ + pid = getpid(); for (;;) { #ifdef FD_SETSIZE @@ -74,7 +78,7 @@ my_svc_run() continue; default: svc_getreqset(&readfds); - if (forked) + if (forked && pid != getpid()) exit(0); } } diff --git a/gnu/usr.sbin/ypserv/yp_svc.c b/gnu/usr.sbin/ypserv/yp_svc.c index b6d8ec5..5e15089 100644 --- a/gnu/usr.sbin/ypserv/yp_svc.c +++ b/gnu/usr.sbin/ypserv/yp_svc.c @@ -322,8 +322,12 @@ int main(int argc, char **argv) * Ignore SIGPIPEs. They can hurt us if someone does a ypcat * and then hits CTRL-C before it terminates. */ + sigaction(SIGPIPE, NULL, &sa); sa.sa_handler = SIG_IGN; + sa.sa_flags |= SA_RESTART; sigaction(SIGPIPE, &sa, NULL); + sigaction(SIGCHLD, NULL, &sa); + sa.sa_flags |= SA_RESTART; sa.sa_handler = reapchild; sigaction(SIGCHLD, &sa, NULL); |