diff options
author | Wynn Wolf Arbor | 2020-05-24 13:49:29 +0200 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-05-24 14:05:54 +0200 |
commit | 53b11e33a3c95301a2849410a9d01ef1d44d2038 (patch) | |
tree | 42c9469fcbedd39c4aeb4a7bf14290e7192dde0e | |
parent | 2ca0c5e6f60a7814d3e84e2baa43b55ba6f5304d (diff) | |
download | slowcgi-53b11e33a3c95301a2849410a9d01ef1d44d2038.tar.gz |
Use pledge(2) only on OpenBSD
-rw-r--r-- | slowcgi.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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]); |