diff --git a/nqptp.c b/nqptp.c index 88cf939..73b0d66 100644 --- a/nqptp.c +++ b/nqptp.c @@ -131,6 +131,11 @@ void termHandler(__attribute__((unused)) int k) { } int main(int argc, char **argv) { +#ifdef CONFIG_FOR_OPENBSD + if (pledge("stdio rpath tmppath inet dns id", NULL) == -1) { + die("pledge: %s", strerror(errno)); + } +#endif int debug_level = 0; int i; @@ -215,6 +220,10 @@ int main(int argc, char **argv) { setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) { die("cannot drop privileges to %s", shairport_user); } + + if (pledge("stdio tmppath inet dns", NULL) == -1) { + die("pledge: %s", strerror(errno)); + } #endif // open the SMI