From: Giuseppe Scrivano Date: Wed, 28 Sep 2016 16:26:25 +0000 (+0200) Subject: audit: disable if cannot create NETLINK_AUDIT socket X-Git-Tag: v232~144^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f006b30bd5a24cb4420e0d439ebb5805b2b4c84d;p=thirdparty%2Fsystemd.git audit: disable if cannot create NETLINK_AUDIT socket --- diff --git a/src/basic/audit-util.c b/src/basic/audit-util.c index 5741fecdd67..d1c96959737 100644 --- a/src/basic/audit-util.c +++ b/src/basic/audit-util.c @@ -92,8 +92,11 @@ bool use_audit(void) { int fd; fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT); - if (fd < 0) - cached_use = errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT; + if (fd < 0) { + cached_use = !IN_SET(errno, EAFNOSUPPORT, EPROTONOSUPPORT, EPERM); + if (errno == EPERM) + log_debug_errno(errno, "Audit access prohibited, won't talk to audit"); + } else { cached_use = true; safe_close(fd);