summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-04-24 13:46:58 +0200
committerSven Eden <yamakuzure@gmx.net>2018-06-28 09:24:07 +0200
commit0c055d8d272d3043e66c276a2e5b57a95c447d6f (patch)
treefb98c70924dfac6c5e783ba891892d32829a5939 /src/basic
parent5d5d1495a3651d3c1b5b58a8d6eb2e9576b212fc (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. (cherry picked from commit 13bb68bbe37f0b39cd45234b09fb1a1da8302020)
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/audit-util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/basic/audit-util.c b/src/basic/audit-util.c
index 973e2e6f8..a0a0ab06c 100644
--- a/src/basic/audit-util.c
+++ b/src/basic/audit-util.c
@@ -96,10 +96,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);
}