summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-04-30 16:44:17 +0000
committerwpaul <wpaul@FreeBSD.org>1999-04-30 16:44:17 +0000
commit981525b53794b17ca5717384c1c75af4a24fca8b (patch)
tree882dda74862b4bcd18b870f8d117d5e688c760c0 /usr.sbin/ypserv
parent5235f7476f368b2ba79cd1d1b1fe8baa01cfd62c (diff)
downloadFreeBSD-src-981525b53794b17ca5717384c1c75af4a24fca8b.zip
FreeBSD-src-981525b53794b17ca5717384c1c75af4a24fca8b.tar.gz
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.
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 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 *
OpenPOWER on IntegriCloud