diff options
author | June McEnroe <june@causal.agency> | 2021-02-01 14:47:32 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-02-01 14:47:32 -0500 |
commit | 8bd0b51140f24f253e8da91112a5e44b53837964 (patch) | |
tree | c1022ec85e1759b6436091c96f9e817300012f39 /daemon.c | |
parent | Remove use of "%n" (diff) | |
download | catsit-1.2.tar.gz catsit-1.2.zip |
Drop pledge privileges after daemonization 1.2
Diffstat (limited to '')
-rw-r--r-- | daemon.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/daemon.c b/daemon.c index 59215f6..f36e277 100644 --- a/daemon.c +++ b/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); |