chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10380a7
)
basic/audit-util: always log the reason when disabling audit logs
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Tue, 24 Apr 2018 11:46:58 +0000
(13:46 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000
(16:47 +0200)
This state is cached, and it's seems OK to log at least once.
src/basic/audit-util.c
patch
|
blob
|
history
diff --git
a/src/basic/audit-util.c
b/src/basic/audit-util.c
index 3f158caeee5e3081310c6d59cf1bbfc3b68caf66..0a4062afdb5b92b2e03dcade0acbf95d88a967c8 100644
(file)
--- 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);
}