Drop pledge privileges after daemonization

This commit is contained in:
C. McEnroe 2021-02-01 14:47:32 -05:00
parent cc8a88c059
commit 8bd0b51140
1 changed files with 5 additions and 0 deletions

View File

@ -307,6 +307,11 @@ int main(int argc, char *argv[]) {
if (len < 0) syslog(LOG_WARNING, "%s: %m", pidPath);
}
#ifdef __OpenBSD__
error = pledge("stdio cpath rpath proc exec id", NULL);
if (error) err(EX_OSERR, "pledge");
#endif
signal(SIGHUP, signalHandler);
signal(SIGINT, signalHandler);
signal(SIGTERM, signalHandler);