From 981525b53794b17ca5717384c1c75af4a24fca8b Mon Sep 17 00:00:00 2001 From: wpaul Date: Fri, 30 Apr 1999 16:44:17 +0000 Subject: 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. --- usr.sbin/ypserv/yp_server.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'usr.sbin/ypserv') diff --git a/usr.sbin/ypserv/yp_server.c b/usr.sbin/ypserv/yp_server.c index b771468..aeaa84d 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 * -- cgit v1.1