policy: print policy denied complaint log for signal broadcasting 85/227485/1
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Thu, 12 Mar 2020 06:13:44 +0000 (15:13 +0900)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Thu, 12 Mar 2020 06:45:37 +0000 (15:45 +0900)
Debugging is difficult due to lack of error information:
When the broadcast signal is blocked by dbus policy,
unlike other types of dbus messages,
dbus-daemon does not print any error logs,
it just passes an error message to the bus monitor.

Change-Id: I9c6c55530d64451403664ea1eee4b703360691eb

bus/bus.c

index 4c35d75..1063d7b 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -1756,7 +1756,8 @@ bus_context_check_security_policy (BusContext          *context,
         complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
                                 "Rejected send message", toggles,
                                 message, sender, proposed_recipient, requested_reply,
-                                (addressed_recipient == proposed_recipient), privilege,
+                                (addressed_recipient == proposed_recipient) || (type == DBUS_MESSAGE_TYPE_SIGNAL),
+                                privilege,
                                 error, out_rule);
         _dbus_verbose ("security policy disallowing message due to sender policy\n");
         if (out_rule)
@@ -1793,7 +1794,8 @@ bus_context_check_security_policy (BusContext          *context,
         complain_about_message(context, DBUS_ERROR_ACCESS_DENIED,
             "Rejected receive message", toggles, message, sender,
             proposed_recipient, requested_reply,
-            (addressed_recipient == proposed_recipient), privilege, error, out_rule);
+            (addressed_recipient == proposed_recipient) || (type == DBUS_MESSAGE_TYPE_SIGNAL),
+            privilege, error, out_rule);
         _dbus_verbose(
             "security policy disallowing message due to recipient policy\n");
         if (out_rule)