From 53b11e33a3c95301a2849410a9d01ef1d44d2038 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Sun, 24 May 2020 13:49:29 +0200 Subject: Use pledge(2) only on OpenBSD --- slowcgi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slowcgi.c b/slowcgi.c index 63e7c1a..660f95e 100644 --- a/slowcgi.c +++ b/slowcgi.c @@ -367,8 +367,10 @@ main(int argc, char *argv[]) setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) lerr(1, "unable to revoke privs"); +#ifdef __OpenBSD__ if (pledge("stdio rpath unix proc exec", NULL) == -1) lerr(1, "pledge"); +#endif SLIST_INIT(&slowcgi_proc.requests); event_init(); @@ -932,8 +934,10 @@ exec_cgi(struct request *c) return; case 0: /* Child process */ +#ifdef __OpenBSD__ if (pledge("stdio rpath exec", NULL) == -1) lerr(1, "pledge"); +#endif close(s_in[0]); close(s_out[0]); close(s_err[0]); -- cgit v1.2.3-2-gb3c3