From 6a5aacd05f021ecd27fed8a9b2432d7f031ad3c2 Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Fri, 25 Sep 2020 11:27:12 +0200 Subject: BUS_RESULT: fix missed changes of TRUE/FALSE to BUS_RESULT The Tizen's branch code that added Cynara integration had changed return types in some functions from dbus_bool_t to BusResult. The code from upstream master branch uses dbus_bool_t. While merging recent changes from the upstream, there were some parts that were merged without changing TRUE/FALSE to BUS_RESULT_* or with checking conditions as bool values instead of checking the enum. The above, and the fact that TRUE==1, FALSE==0, BUS_RESULT_TRUE==0, BUS_RESULT_FALSE==1 has led to aborting on asserts, when enabled. This could also lead to issues with activation. This commit fixes the TRUE/FALSE handling where needed. Change-Id: I6cbf1aa0b43699464c9214b50fd8bb23a84709e8 --- bus/activation.c | 2 +- bus/bus.c | 4 ++-- bus/driver.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bus/activation.c b/bus/activation.c index ef1aa18c..ba4dee88 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -1984,7 +1984,7 @@ bus_activation_activate_service (BusActivation *activation, BUS_SET_OOM (error); bus_pending_activation_unref (pending_activation); bus_pending_activation_entry_free (pending_activation_entry); - return FALSE; + return BUS_RESULT_FALSE; } } diff --git a/bus/bus.c b/bus/bus.c index 96b51dec..86931d0f 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -1656,7 +1656,7 @@ bus_context_check_security_policy (BusContext *context, _dbus_verbose ("SELinux security check denying send to service\n"); } - return FALSE; + return BUS_RESULT_FALSE; } /* next verify AppArmor access controls. If allowed then @@ -1674,7 +1674,7 @@ bus_context_check_security_policy (BusContext *context, src ? src : DBUS_SERVICE_DBUS, activation_entry, error)) - return FALSE; + return BUS_RESULT_FALSE; if (!bus_connection_is_active (sender)) { diff --git a/bus/driver.c b/bus/driver.c index c468fe58..ba227a4b 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -973,8 +973,8 @@ bus_driver_handle_activate_service (DBusConnection *connection, retval = BUS_RESULT_FALSE; - if (!bus_activation_activate_service (activation, connection, transaction, FALSE, - message, name, error, NULL)) + if (bus_activation_activate_service (activation, connection, transaction, FALSE, + message, name, error, NULL) == BUS_RESULT_FALSE) { _DBUS_ASSERT_ERROR_IS_SET (error); _dbus_verbose ("bus_activation_activate_service() failed\n"); @@ -1058,8 +1058,8 @@ bus_driver_send_or_activate (BusTransaction *transaction, return FALSE; } - if (!bus_activation_activate_service (activation, NULL, transaction, TRUE, - message, service_name, error, NULL)) + if (bus_activation_activate_service (activation, NULL, transaction, TRUE, + message, service_name, error, NULL) == BUS_RESULT_FALSE) { _DBUS_ASSERT_ERROR_IS_SET (error); _dbus_verbose ("bus_activation_activate_service() failed"); @@ -1111,7 +1111,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "Cannot change activation environment " "on a system bus."); - return FALSE; + return BUS_RESULT_FALSE; } activation = bus_connection_get_activation (connection); -- cgit v1.2.3