From 6cd8f6959b154a1a3af9a98abc91d9620edc97b0 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 16 Apr 2018 19:47:00 +0100 Subject: [PATCH 09/39] bus_registry_list_services: Take the DBusConnection that wants to know This will be necessary when we give connections from containers a different answer that only lists a subset of the names. Signed-off-by: Simon McVittie --- bus/driver.c | 2 +- bus/services.c | 3 ++- bus/services.h | 3 ++- bus/stats.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bus/driver.c b/bus/driver.c index d91c15f0..e9342010 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -608,7 +608,7 @@ bus_driver_handle_list_services (DBusConnection *connection, return FALSE; } - if (!bus_registry_list_services (registry, &services, &len)) + if (!bus_registry_list_services (registry, &services, &len, connection)) { dbus_message_unref (reply); BUS_SET_OOM (error); diff --git a/bus/services.c b/bus/services.c index 1393361d..c1e645ed 100644 --- a/bus/services.c +++ b/bus/services.c @@ -335,7 +335,8 @@ bus_registry_foreach (BusRegistry *registry, dbus_bool_t bus_registry_list_services (BusRegistry *registry, char ***listp, - int *array_len) + int *array_len, + DBusConnection *observer) { int i, j, len; char **retval; diff --git a/bus/services.h b/bus/services.h index 4ec510f3..9bfe1fbb 100644 --- a/bus/services.h +++ b/bus/services.h @@ -49,7 +49,8 @@ void bus_registry_foreach (BusRegistry *registry void *data); dbus_bool_t bus_registry_list_services (BusRegistry *registry, char ***listp, - int *array_len); + int *array_len, + DBusConnection *observer); dbus_bool_t bus_registry_acquire_service (BusRegistry *registry, DBusConnection *connection, const DBusString *service_name, diff --git a/bus/stats.c b/bus/stats.c index 15822556..0524d4b5 100644 --- a/bus/stats.c +++ b/bus/stats.c @@ -245,7 +245,8 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, context = bus_transaction_get_context (transaction); matchmaker = bus_context_get_matchmaker (context); - if (!bus_registry_list_services (registry, &services, &services_len)) + if (!bus_registry_list_services (registry, &services, &services_len, + caller_connection)) return FALSE; reply = dbus_message_new_method_return (message); -- 2.17.0