mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
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.
This commit is contained in:
parent
4355f1c9da
commit
13bb68bbe3
|
@ -82,10 +82,9 @@ bool use_audit(void) {
|
|||
fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT);
|
||||
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 {
|
||||
if (!cached_use)
|
||||
log_debug_errno(errno, "Won't talk to audit: %m");
|
||||
} else {
|
||||
cached_use = true;
|
||||
safe_close(fd);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue