diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-04-24 13:46:58 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 9e00c2f9ead0f57b41248850da317483e764ca42 (patch) | |
tree | ab4e9590488b83b479dff4e60c95021f7da326be /src/basic/audit-util.c | |
parent | 10380a7990aeed007a771bcf955e203272bfce54 (diff) |
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.
Diffstat (limited to 'src/basic/audit-util.c')
-rw-r--r-- | src/basic/audit-util.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/basic/audit-util.c b/src/basic/audit-util.c index 3f158caee..0a4062afd 100644 --- a/src/basic/audit-util.c +++ b/src/basic/audit-util.c @@ -83,10 +83,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); } |