diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-12 01:44:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-12 01:44:58 +0000 |
commit | ccac261ae2eecf7701f7600f2129ea1eca0ec017 (patch) | |
tree | 89182f2192447516494a5270c041409c5867c1da /usr.sbin/ypserv | |
parent | a9adec2e3a4eb05291c4484bf8918a60cb13885d (diff) |
paranoia in vfork land
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv_proc.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/usr.sbin/ypserv/ypserv/ypserv_proc.c b/usr.sbin/ypserv/ypserv/ypserv_proc.c index af2d68f83e6..62232366aab 100644 --- a/usr.sbin/ypserv/ypserv/ypserv_proc.c +++ b/usr.sbin/ypserv/ypserv/ypserv_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv_proc.c,v 1.13 1997/06/02 19:50:42 dm Exp $ */ +/* $OpenBSD: ypserv_proc.c,v 1.14 1997/09/12 01:44:57 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypserv_proc.c,v 1.13 1997/06/02 19:50:42 dm Exp $"; +static char rcsid[] = "$OpenBSD: ypserv_proc.c,v 1.14 1997/09/12 01:44:57 deraadt Exp $"; #endif #include <rpc/rpc.h> @@ -299,18 +299,17 @@ ypproc_xfr_2_svc(argp, rqstp) return(NULL); } + snprintf(tid, sizeof(tid), "%d",argp->transid); + snprintf(prog, sizeof(prog), "%d", argp->prog); + snprintf(port, sizeof(port), "%d", argp->port); + ipadd = inet_ntoa(caller->sin_addr); + pid = vfork(); if (pid == -1) { svcerr_systemerr(rqstp->rq_xprt); return(NULL); } - if (pid == 0) { - snprintf(tid, sizeof(tid), "%d",argp->transid); - snprintf(prog, sizeof(prog), "%d", argp->prog); - snprintf(port, sizeof(port), "%d", argp->port); - ipadd = inet_ntoa(caller->sin_addr); - execl(ypxfr_proc, "ypxfr", "-d", argp->map_parms.domain, "-C",tid, prog, ipadd, port, argp->map_parms.map, NULL); _exit(1); @@ -927,13 +926,10 @@ bail: } pid = vfork(); - if (pid == -1) { svcerr_systemerr(rqstp->rq_xprt); return(NULL); - } - if (pid == 0) { execl(yppush_proc, "yppush", "-d", argp->yppush_req_domain, argp->yppush_req_map, NULL); @@ -978,13 +974,10 @@ bail: } pid = vfork(); - if (pid == -1) { svcerr_systemerr(rqstp->rq_xprt); return(NULL); - } - if (pid == 0) { execl(ypxfr_proc, "ypxfr", "-d", argp->yppull_req_domain, argp->yppull_req_map, NULL); @@ -1031,13 +1024,10 @@ bail: } pid = vfork(); - if (pid == -1) { svcerr_systemerr(rqstp->rq_xprt); return(NULL); - } - if (pid == 0) { execl(ypxfr_proc, "ypxfr", "-d", argp->ypget_req_domain, "-h", argp->ypget_req_owner, argp->yppush_req_map, NULL); |