diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bus/bus.c | 6 | ||||
-rw-r--r-- | bus/dispatch.c | 4 | ||||
-rw-r--r-- | bus/policy.c | 16 | ||||
-rw-r--r-- | dbus/dbus-message.c | 21 | ||||
-rw-r--r-- | dbus/dbus-message.h | 12 |
6 files changed, 34 insertions, 32 deletions
@@ -1,5 +1,12 @@ 2003-04-24 Havoc Pennington <hp@redhat.com> + * dbus/dbus-message.c (dbus_message_name_is): rename + (dbus_message_service_is): rename + (dbus_message_sender_is): rename + (dbus_message_get_service): rename + +2003-04-24 Havoc Pennington <hp@redhat.com> + * configure.in: add --enable-checks * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments @@ -889,7 +889,7 @@ bus_context_check_security_policy (BusContext *context, context->registry, recipient, message)) { - const char *dest = dbus_message_get_service (message); + const char *dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "A security policy in place prevents this sender " "from sending this message to this recipient, " @@ -905,7 +905,7 @@ bus_context_check_security_policy (BusContext *context, context->registry, sender, message)) { - const char *dest = dbus_message_get_service (message); + const char *dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "A security policy in place prevents this recipient " "from receiving this message from this sender, " @@ -921,7 +921,7 @@ bus_context_check_security_policy (BusContext *context, dbus_connection_get_outgoing_size (recipient) > context->max_outgoing_bytes) { - const char *dest = dbus_message_get_service (message); + const char *dest = dbus_message_get_destination (message); dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED, "The destination service \"%s\" has a full message queue", dest ? dest : DBUS_SERVICE_DBUS); diff --git a/bus/dispatch.c b/bus/dispatch.c index e38b3402..14c6531e 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -125,7 +125,7 @@ bus_dispatch (DBusConnection *connection, /* Ref connection in case we disconnect it at some point in here */ dbus_connection_ref (connection); - service_name = dbus_message_get_service (message); + service_name = dbus_message_get_destination (message); message_name = dbus_message_get_name (message); _dbus_assert (message_name != NULL); /* DBusMessageLoader is supposed to check this */ @@ -176,7 +176,7 @@ bus_dispatch (DBusConnection *connection, * reallocated, and thus the service_name pointer will become * invalid. */ - service_name = dbus_message_get_service (message); + service_name = dbus_message_get_destination (message); } if (strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */ diff --git a/bus/policy.c b/bus/policy.c index 7d9b4b76..0a002a8c 100644 --- a/bus/policy.c +++ b/bus/policy.c @@ -693,8 +693,8 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, if (rule->d.send.message_name != NULL) { - if (!dbus_message_name_is (message, - rule->d.send.message_name)) + if (!dbus_message_has_name (message, + rule->d.send.message_name)) continue; } @@ -707,8 +707,8 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, */ if (receiver == NULL) { - if (!dbus_message_sender_is (message, - rule->d.send.destination)) + if (!dbus_message_has_sender (message, + rule->d.send.destination)) continue; } else @@ -765,8 +765,8 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, if (rule->d.receive.message_name != NULL) { - if (!dbus_message_name_is (message, - rule->d.receive.message_name)) + if (!dbus_message_has_name (message, + rule->d.receive.message_name)) continue; } @@ -779,8 +779,8 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, */ if (sender == NULL) { - if (!dbus_message_sender_is (message, - rule->d.receive.origin)) + if (!dbus_message_has_sender (message, + rule->d.receive.origin)) continue; } else diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index c9053eb9..29995fdd 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -1197,17 +1197,12 @@ dbus_message_get_name (DBusMessage *message) /** * Gets the destination service of a message. - * - * @todo I think if we have set_sender/get_sender, - * this function might be better named set_destination/ - * get_destination for clarity, as the sender - * is also a service name. * * @param message the message * @returns the message destination service (should not be freed) */ const char* -dbus_message_get_service (DBusMessage *message) +dbus_message_get_destination (DBusMessage *message) { _dbus_return_val_if_fail (message != NULL, NULL); @@ -3743,8 +3738,8 @@ dbus_message_get_sender (DBusMessage *message) * @returns #TRUE if the message has the given name */ dbus_bool_t -dbus_message_name_is (DBusMessage *message, - const char *name) +dbus_message_has_name (DBusMessage *message, + const char *name) { const char *n; @@ -3770,15 +3765,15 @@ dbus_message_name_is (DBusMessage *message, * @returns #TRUE if the message has the given destination service */ dbus_bool_t -dbus_message_service_is (DBusMessage *message, - const char *service) +dbus_message_has_destination (DBusMessage *message, + const char *service) { const char *s; _dbus_return_val_if_fail (message != NULL, FALSE); _dbus_return_val_if_fail (service != NULL, FALSE); - s = dbus_message_get_service (message); + s = dbus_message_get_destination (message); if (s && strcmp (s, service) == 0) return TRUE; @@ -3801,8 +3796,8 @@ dbus_message_service_is (DBusMessage *message, * @returns #TRUE if the message has the given origin service */ dbus_bool_t -dbus_message_sender_is (DBusMessage *message, - const char *service) +dbus_message_has_sender (DBusMessage *message, + const char *service) { const char *s; diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h index f7ca1c4d..177f5a91 100644 --- a/dbus/dbus-message.h +++ b/dbus/dbus-message.h @@ -56,8 +56,8 @@ struct DBusMessageIter }; -DBusMessage* dbus_message_new (const char *service, - const char *name); +DBusMessage* dbus_message_new (const char *name, + const char *destination_service); DBusMessage* dbus_message_new_reply (DBusMessage *original_message); DBusMessage* dbus_message_new_error_reply (DBusMessage *original_message, const char *error_name, @@ -67,18 +67,18 @@ DBusMessage *dbus_message_copy (const DBusMessage *message); void dbus_message_ref (DBusMessage *message); void dbus_message_unref (DBusMessage *message); const char* dbus_message_get_name (DBusMessage *message); -const char* dbus_message_get_service (DBusMessage *message); +const char* dbus_message_get_destination (DBusMessage *message); dbus_bool_t dbus_message_set_sender (DBusMessage *message, const char *sender); const char* dbus_message_get_sender (DBusMessage *message); void dbus_message_set_is_error (DBusMessage *message, dbus_bool_t is_error_reply); dbus_bool_t dbus_message_get_is_error (DBusMessage *message); -dbus_bool_t dbus_message_name_is (DBusMessage *message, +dbus_bool_t dbus_message_has_name (DBusMessage *message, const char *name); -dbus_bool_t dbus_message_service_is (DBusMessage *message, +dbus_bool_t dbus_message_has_destination (DBusMessage *message, const char *service); -dbus_bool_t dbus_message_sender_is (DBusMessage *message, +dbus_bool_t dbus_message_has_sender (DBusMessage *message, const char *service); dbus_uint32_t dbus_message_get_serial (DBusMessage *message); dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message, |