summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bus/audit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bus/audit.c b/bus/audit.c
index 954afa71..7705e425 100644
--- a/bus/audit.c
+++ b/bus/audit.c
@@ -52,8 +52,15 @@ void
bus_audit_init (BusContext *context)
{
#ifdef HAVE_LIBAUDIT
+ int i;
+
capng_get_caps_process ();
+ /* Work around a bug in libcap-ng < 0.7.7: it leaks a fd, which isn't
+ * close-on-exec. Assume it will be one of the first few fds. */
+ for (i = 3; i < 42; i++)
+ _dbus_fd_set_close_on_exec (i);
+
if (!capng_have_capability (CAPNG_EFFECTIVE, CAP_AUDIT_WRITE))
return;