From 8b0edc8c86e3766792220dabd2b65b29f73ef794 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 17 Apr 2018 12:48:23 +0100 Subject: [PATCH 05/39] bus_service_list_queued_owners: Don't return a DBusError This makes it clearer that the only possible error is out-of-memory, so its use in ListQueuedOwners() is not leaking information to callers that might not be allowed to know the difference between "doesn't exist" and "exists but you are not allowed to know that". Signed-off-by: Simon McVittie --- bus/driver.c | 9 +++++---- bus/services.c | 4 +--- bus/services.h | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/bus/driver.c b/bus/driver.c index a131170d..8015f28b 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -1581,10 +1581,11 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection, } else { - if (!bus_service_list_queued_owners (service, - &base_names, - error)) - goto failed; + if (!bus_service_list_queued_owners (service, &base_names)) + { + BUS_SET_OOM (error); + goto failed; + } } _dbus_assert (base_names != NULL); diff --git a/bus/services.c b/bus/services.c index 127edda0..b7a4fdfd 100644 --- a/bus/services.c +++ b/bus/services.c @@ -1289,8 +1289,7 @@ bus_service_has_owner (BusService *service, dbus_bool_t bus_service_list_queued_owners (BusService *service, - DBusList **return_list, - DBusError *error) + DBusList **return_list) { DBusList *link; @@ -1317,6 +1316,5 @@ bus_service_list_queued_owners (BusService *service, oom: _dbus_list_clear (return_list); - BUS_SET_OOM (error); return FALSE; } diff --git a/bus/services.h b/bus/services.h index 056dd9fa..4ec510f3 100644 --- a/bus/services.h +++ b/bus/services.h @@ -87,8 +87,7 @@ BusOwner* bus_service_get_primary_owner (BusService *service); dbus_bool_t bus_service_get_allow_replacement (BusService *service); const char* bus_service_get_name (BusService *service); dbus_bool_t bus_service_list_queued_owners (BusService *service, - DBusList **return_list, - DBusError *error); + DBusList **return_list); DBusConnection* bus_service_get_primary_owners_connection (BusService *service); #endif /* BUS_SERVICES_H */ -- 2.17.0