aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1999-04-30 16:44:17 +0000
committerBill Paul <wpaul@FreeBSD.org>1999-04-30 16:44:17 +0000
commitdc273a2f0762927cad78dd89b0b3727eeb8b435f (patch)
treeb2ad7fbaae0cb25265669df34fbd0653dd4988ce /usr.sbin/ypserv
parent0a9766ee3a448ff4368c878d929201a93386f28f (diff)
downloadsrc-dc273a2f0762927cad78dd89b0b3727eeb8b435f.tar.gz
src-dc273a2f0762927cad78dd89b0b3727eeb8b435f.zip
Close PR #10970: exit at the end of ypproc_all_2_svc() instead of returning.
This really fixes the condition where a child creates children of its own. I'm leaving the previous sanity tests in though, since they shouldn't hurt, and will give an indication if this ever happens again.
Notes
Notes: svn path=/head/; revision=46205
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r--usr.sbin/ypserv/yp_server.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/ypserv/yp_server.c b/usr.sbin/ypserv/yp_server.c
index b771468bafe1..aeaa84d58e31 100644
--- a/usr.sbin/ypserv/yp_server.c
+++ b/usr.sbin/ypserv/yp_server.c
@@ -392,6 +392,13 @@ ypproc_xfr_2_svc(ypreq_xfr *argp, struct svc_req *rqstp)
}
yp_error("ypxfr execl(%s): %s", ypxfr_command, strerror(errno));
YPXFR_RETURN(YPXFR_XFRERR)
+ /*
+ * Just to safe, prevent PR #10970 from biting us in
+ * the unlikely case that execing ypxfr fails. We don't
+ * want to have any child processes spawned from this
+ * child process.
+ */
+ _exit(0);
break;
}
case -1:
@@ -540,10 +547,10 @@ ypproc_all_2_svc(ypreq_nokey *argp, struct svc_req *rqstp)
svc_sendreply(rqstp->rq_xprt, xdr_my_ypresp_all, (char *)&result);
/*
- * Returning NULL prevents the dispatcher from calling
- * svc_sendreply() since we already did it.
+ * Proper fix for PR #10970: exit here so that we don't risk
+ * having a child spawned from this sub-process.
*/
- return (NULL);
+ _exit(0);
}
ypresp_master *