build: check for audit support before adding AmbientCapabilities feature

Currently the AmbientCapabilities are added even if meson
didn't find audit or cap-ng.
This commit is contained in:
Soapux 2025-03-25 16:07:55 -05:00
parent cddd0a7c94
commit 6d2aaef098

View file

@ -574,7 +574,9 @@ else
error('libaudit support requested but not found')
endif
# For the systemd system unit
data_config.set('AMBIENT_CAPS', 'AmbientCapabilities=CAP_AUDIT_WRITE')
if have_libaudit
data_config.set('AMBIENT_CAPS', 'AmbientCapabilities=CAP_AUDIT_WRITE')
endif
endif
config.set('HAVE_LIBAUDIT', have_libaudit)