Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus_audit_init (BusContext *context)
{
#ifdef HAVE_LIBAUDIT
+ capng_get_caps_process ();
+
+ if (!capng_have_capability (CAPNG_EFFECTIVE, CAP_AUDIT_WRITE))
+ return;
+
audit_fd = audit_open ();
if (audit_fd < 0)
#ifdef HAVE_LIBAUDIT
if (audit_fd >= 0)
{
- capng_get_caps_process ();
-
- if (!capng_have_capability (CAPNG_EFFECTIVE, CAP_AUDIT_WRITE))
- return -1;
-
return audit_fd;
}
#endif