summaryrefslogtreecommitdiff
path: root/bus/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'bus/driver.c')
-rw-r--r--bus/driver.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bus/driver.c b/bus/driver.c
index 53bd5590..aab922ae 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -1924,6 +1924,8 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
DBusError *error)
{
char **match_rules = NULL;
+ const char *bustype;
+ BusContext *context;
BusMatchRule *rule;
DBusList *rules = NULL;
DBusList *iter;
@@ -1938,6 +1940,11 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
if (!bus_driver_check_message_is_for_us (message, error))
goto out;
+ context = bus_transaction_get_context (transaction);
+ bustype = context ? bus_context_get_type (context) : NULL;
+ if (!bus_apparmor_allows_eavesdropping (connection, bustype, error))
+ goto out;
+
if (!bus_driver_check_caller_is_privileged (connection, transaction,
message, error))
goto out;