commit db623d7551caaed88664d4e7c379b231f89c6ca4 from: Omar Polo date: Fri Sep 17 16:17:16 2021 UTC fix syslog logging on FreeBSD Due to capsicum(4), opening the log on-demand via syslog(3) fails. openlog(LOG_NDELAY) forces the log to be opened immediately, before we enter capsicum. This doesn't affect OpenBSD (where pledge(2) doesn't stop syslog) nor linux (where the log process is not sandboxed.) Reported by Karl Jeacle, thank you! commit - f2478b332f0f60a53113cdc6434f134c34a2155c commit + db623d7551caaed88664d4e7c379b231f89c6ca4 blob - 404d43f53302e7aab2d10862e4e651e057207790 blob + 81064e7e8fa01aa4cf0308bda9641a48f3ef3ca0 --- log.c +++ log.c @@ -327,6 +327,8 @@ int logger_main(int fd, struct imsgbuf *ibuf) { log = stderr; + + openlog(getprogname(), LOG_NDELAY, LOG_DAEMON); event_init(); @@ -337,5 +339,7 @@ logger_main(int fd, struct imsgbuf *ibuf) event_dispatch(); + closelog(); + return 0; }