mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03: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 New Issue
Block a user