chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
audit: disable if cannot create NETLINK_AUDIT socket
[elogind.git]
/
src
/
basic
/
audit-util.c
diff --git
a/src/basic/audit-util.c
b/src/basic/audit-util.c
index 7c6f890cb253e9196953656ec42bae820eec0e88..2b557839446d87d49704b9db5aa4085748dd061a 100644
(file)
--- a/
src/basic/audit-util.c
+++ b/
src/basic/audit-util.c
@@
-93,8
+93,11
@@
bool use_audit(void) {
int fd;
fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT);
int fd;
fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT);
- if (fd < 0)
- cached_use = errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT;
+ 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 {
cached_use = true;
safe_close(fd);
else {
cached_use = true;
safe_close(fd);