2003-10-22 Havoc Pennington <hp@redhat.com>
authorHavoc Pennington <hp@redhat.com>
Wed, 22 Oct 2003 16:01:08 +0000 (16:01 +0000)
committerHavoc Pennington <hp@redhat.com>
Wed, 22 Oct 2003 16:01:08 +0000 (16:01 +0000)
* 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

ChangeLog
bus/bus.c
bus/connection.c
dbus/dbus-marshal.c
dbus/dbus-message.c
doc/TODO

index 029fa71..782a3f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
+
 2003-10-20  Havoc Pennington  <hp@redhat.com>
 
         hmm, make check is currently not passing.
index 43882c5..6935945 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -919,9 +919,9 @@ bus_context_check_security_policy (BusContext     *context,
   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 65ebdb2..db9cbaa 100644 (file)
@@ -1862,6 +1862,13 @@ bus_transaction_send_from_driver (BusTransaction *transaction,
   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);
   
index da7bbd4..428e1fd 100644 (file)
@@ -1808,6 +1808,8 @@ _dbus_marshal_validate_type   (const DBusString *str,
        *end_pos = pos + 1;
       return TRUE;
     }
+
+  _dbus_verbose ("'%c' %d invalid type code\n", (int) *data, (int) *data);
   
   return FALSE;
 }
index d3b1a3d..ccd4a44 100644 (file)
@@ -4907,13 +4907,15 @@ decode_header_data (const DBusString   *data,
 
       if (!_dbus_marshal_validate_type (data, pos, &type, &pos))
        {
-          _dbus_verbose ("Failed to validate type of named header field\n");
+          _dbus_verbose ("Failed to validate type of named header field pos = %d\n",
+                         pos);
          return FALSE;
        }
       
       if (!_dbus_marshal_validate_arg (data, byte_order, 0, type, -1, pos, &new_pos))
         {
-          _dbus_verbose ("Failed to validate argument to named header field\n");
+          _dbus_verbose ("Failed to validate argument to named header field pos = %d\n",
+                         pos);
           return FALSE;
         }
 
@@ -5180,8 +5182,8 @@ load_one_message (DBusMessageLoader *loader,
   message = NULL;
   oom = FALSE;
   
-#if 0
-  _dbus_verbose_bytes_of_string (&loader->data, 0, header_len + body_len);
+#if 1
+  _dbus_verbose_bytes_of_string (&loader->data, 0, header_len /* + body_len */);
 #endif   
 
   if (!decode_header_data (&loader->data,
index f9cb9db..de77933 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
  - the auth protocol may as well use hex encoding instead of 
    base64, then we can dump the base64 implementation and 
    save some bloat.
+
+ - rename HEADER_FIELD_SERVICE -> HEADER_FIELD_DESTINATION 
+   and HEADER_FIELD_SENDER_SERVICE -> HEADER_FIELD_SENDER 
+   for both dbus-protocol.h and in the spec