dbus/bus bus.c,1.45,1.46 connection.c,1.49,1.50

Havoc Pennington hp@pdx.freedesktop.org
Wed, 22 Oct 2003 09:01:10 -0700


Update of /cvs/dbus/dbus/bus
In directory pdx:/tmp/cvs-serv6152/bus

Modified Files:
	bus.c connection.c 
Log Message:
2003-10-22  Havoc Pennington  <hp@redhat.com>

	* bus/bus.c (bus_context_check_security_policy): fix up assertion

	* bus/connection.c (bus_transaction_send_from_driver): set the
	destination to the connection's base service



Index: bus.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/bus.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- bus.c	21 Oct 2003 05:46:51 -0000	1.45
+++ bus.c	22 Oct 2003 16:01:08 -0000	1.46
@@ -919,9 +919,9 @@
   type = dbus_message_get_type (message);
   
   /* dispatch.c was supposed to ensure these invariants */
-  /* FIXME this assertion is failing in make check */
   _dbus_assert (dbus_message_get_destination (message) != NULL ||
-                type == DBUS_MESSAGE_TYPE_SIGNAL);
+                type == DBUS_MESSAGE_TYPE_SIGNAL ||
+                (sender == NULL && !bus_connection_is_active (proposed_recipient)));
   _dbus_assert (type == DBUS_MESSAGE_TYPE_SIGNAL ||
                 addressed_recipient != NULL ||
                 strcmp (dbus_message_get_destination (message), DBUS_SERVICE_ORG_FREEDESKTOP_DBUS) == 0);

Index: connection.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/connection.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- connection.c	16 Oct 2003 06:34:51 -0000	1.49
+++ connection.c	22 Oct 2003 16:01:08 -0000	1.50
@@ -1862,6 +1862,13 @@
   if (!dbus_message_set_sender (message, DBUS_SERVICE_ORG_FREEDESKTOP_DBUS))
     return FALSE;
 
+  if (bus_connection_is_active (connection))
+    {
+      if (!dbus_message_set_destination (message,
+                                         bus_connection_get_name (connection)))
+        return FALSE;
+    }
+  
   /* bus driver never wants a reply */
   dbus_message_set_no_reply (message, TRUE);