diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-08 14:02:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-08 14:02:10 +0000 |
commit | 8a9d6d97d63cb1bb4d85c18f96778de4c4cebe2b (patch) | |
tree | c3dc201e053669ac8d6c839f36fea7311d21718b /usr.sbin/portmap | |
parent | c9156cf22c1fadfdc6a857ee39710e40207ec5e2 (diff) |
portmap's main process can be tame "stdio rpath inet proc"; proc is
for the callit interface needing to fork, and parent needing to wait.
that child can drop to "stdio rpath inet".
It is possible some libc/rpc codepath has not yet been figured out, but
commiting it is the best way to get it tested. Tested what I could myself,
but noone answered my call for testing...
Diffstat (limited to 'usr.sbin/portmap')
-rw-r--r-- | usr.sbin/portmap/portmap.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/portmap/portmap.c b/usr.sbin/portmap/portmap.c index c5bf395eb3b..4259e357668 100644 --- a/usr.sbin/portmap/portmap.c +++ b/usr.sbin/portmap/portmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: portmap.c,v 1.45 2015/09/13 15:44:47 guenther Exp $ */ +/* $OpenBSD: portmap.c,v 1.46 2015/10/08 14:02:09 deraadt Exp $ */ /*- * Copyright (c) 1996, 1997 Theo de Raadt (OpenBSD). All rights reserved. @@ -246,6 +246,9 @@ main(int argc, char *argv[]) } endpwent(); + if (tame("stdio rpath inet proc", NULL) == -1) + err(1, "tame"); + if (svc_register(xprt, PMAPPROG, PMAPVERS, reg_service, FALSE) == 0) { syslog(LOG_ERR, "svc_register failed."); exit(1); @@ -604,6 +607,10 @@ callit(struct svc_req *rqstp, SVCXPRT *xprt) a.rmt_prog); return; } + + if (tame("stdio rpath inet", NULL) == -1) + err(1, "tame"); + port = pml->pml_map.pm_port; get_myaddress(&me); me.sin_port = htons(port); |