BUS_RESULT: fix missed changes of TRUE/FALSE to BUS_RESULT 79/244879/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/hotfix/20201103.000322 accepted/tizen/unified/20200928.072833 submit/tizen/20200925.142828 submit/tizen_6.0/20201029.205501 submit/tizen_6.0_hotfix/20201102.192901 submit/tizen_6.0_hotfix/20201103.115101 tizen_6.0.m2_release
authorAdrian Szyndela <adrian.s@samsung.com>
Fri, 25 Sep 2020 09:27:12 +0000 (11:27 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 25 Sep 2020 09:47:48 +0000 (11:47 +0200)
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
bus/bus.c
bus/driver.c

index ef1aa18..ba4dee8 100644 (file)
@@ -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;
             }
         }
 
index 96b51de..86931d0 100644 (file)
--- 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))
         {
index c468fe5..ba227a4 100644 (file)
@@ -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);