From ac676a57f8f30fc58f74538fafd48c3bc07308a7 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Mon, 15 Sep 2014 11:25:39 +0200 Subject: [PATCH 2/2] Throw a warning if we cannot open the audit socket as a session bus This will effectively print a warning when failing to open the audit socket running as a session bus. The call to audit_open() should succeed even if the dbus-daemon doesn't have the CAP_AUDIT_WRITE capability. https://bugs.freedesktop.org/show_bug.cgi?id=83856 --- bus/apparmor.c | 3 --- bus/selinux.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/bus/apparmor.c b/bus/apparmor.c index a1b3621..caa58b6 100644 --- a/bus/apparmor.c +++ b/bus/apparmor.c @@ -116,9 +116,6 @@ bus_apparmor_audit_init (void) /* If kernel doesn't support audit, bail out */ if (errno == EINVAL || errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT) return; - /* If user bus, bail out */ - if (errno == EPERM && getuid () != 0) - return; _dbus_warn ("Failed opening connection to the audit subsystem"); } #endif /* HAVE_LIBAUDIT */ diff --git a/bus/selinux.c b/bus/selinux.c index 2b8e5db..cf946c8 100644 --- a/bus/selinux.c +++ b/bus/selinux.c @@ -130,9 +130,6 @@ bus_selinux_audit_init(void) /* If kernel doesn't support audit, bail out */ if (errno == EINVAL || errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT) return; - /* If user bus, bail out */ - if (errno == EPERM && getuid() != 0) - return; _dbus_warn ("Failed opening connection to the audit subsystem"); } #endif /* HAVE_LIBAUDIT */ -- 2.1.4