Drop pledge privileges after daemonization
This commit is contained in:
parent
cc8a88c059
commit
8bd0b51140
5
daemon.c
5
daemon.c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user