Commit Diff
- Commit:
db623d7551caaed88664d4e7c379b231f89c6ca4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- 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!
- Actions:
- Patch | Tree
--- 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; }