summaryrefslogtreecommitdiff
path: root/usr.sbin/inetd/inetd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-rw-r--r--usr.sbin/inetd/inetd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 8879121105b..2e3e5b174b6 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.154 2016/08/25 05:23:19 tedu Exp $ */
+/* $OpenBSD: inetd.c,v 1.155 2017/10/04 18:08:26 benno Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -1763,8 +1763,13 @@ spawn(int ctrl, short events, void *xsep)
return;
}
- if (pledge("stdio rpath getpw inet proc exec id", NULL) == -1)
- err(1, "pledge");
+ if (sep->se_family == AF_UNIX) {
+ if (pledge("stdio rpath cpath getpw inet proc exec id", NULL) == -1)
+ err(1, "pledge");
+ } else {
+ if (pledge("stdio rpath getpw inet proc exec id", NULL) == -1)
+ err(1, "pledge");
+ }
if (pid && sep->se_wait) {
sep->se_wait = pid;