Skip to content

Commit 13bb68b

Browse files
committed
basic/audit-util: always log the reason when disabling audit logs
This state is cached, and it's seems OK to log at least once.
1 parent 4355f1c commit 13bb68b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/basic/audit-util.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,9 @@ bool use_audit(void) {
8282
fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT);
8383
if (fd < 0) {
8484
cached_use = !IN_SET(errno, EAFNOSUPPORT, EPROTONOSUPPORT, EPERM);
85-
if (errno == EPERM)
86-
log_debug_errno(errno, "Audit access prohibited, won't talk to audit");
87-
}
88-
else {
85+
if (!cached_use)
86+
log_debug_errno(errno, "Won't talk to audit: %m");
87+
} else {
8988
cached_use = true;
9089
safe_close(fd);
9190
}

0 commit comments

Comments
 (0)