]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
audit: shortcut some audit syscalls if we are compiled without audit support anyway 38998/head
authorLennart Poettering <lennart@poettering.net>
Mon, 8 Sep 2025 13:28:00 +0000 (15:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Sep 2025 14:30:13 +0000 (16:30 +0200)
src/shared/libaudit-util.c

index bacdb641dd479a1640b3c158c1405557fa4ee019..f0fd0a555c82eaa86094175a1a93733ccbdd749c 100644 (file)
@@ -36,7 +36,6 @@ int dlopen_libaudit(void) {
                         DLSYM_ARG(audit_log_user_comm_message),
                         DLSYM_ARG(audit_open));
 }
-#endif
 
 static int try_audit_request(int fd) {
         struct iovec iov;
@@ -75,8 +74,10 @@ static int try_audit_request(int fd) {
 
         return msg.err.error;
 }
+#endif
 
 bool use_audit(void) {
+#if HAVE_AUDIT
         static int cached_use = -1;
         int r;
 
@@ -112,6 +113,9 @@ bool use_audit(void) {
         }
 
         return cached_use;
+#else
+        return false;
+#endif
 }
 
 int close_audit_fd(int fd) {