From 6a65f4802e95ba442c520f8e225da837e0a9f73b Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 10 Oct 2003 02:42:21 +0000 Subject: 2003-10-09 Havoc Pennington Make matching rules theoretically work (add parser). * bus/bus.c (bus_context_check_security_policy): fix up to handle the case where destination is explicitly specified as bus driver and someone else is eavesdropping. * bus/policy.c (bus_client_policy_check_can_receive): fix up definition of eavesdropping and assertion * tools/dbus-send.c (main): use dbus_message_type_from_string * bus/signals.c (bus_match_rule_parse): implement * dbus/dbus-message.c (dbus_message_type_from_string): new * dbus/dbus-errors.h (DBUS_ERROR_MATCH_RULE_INVALID): add --- tools/dbus-send.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tools/dbus-send.c') diff --git a/tools/dbus-send.c b/tools/dbus-send.c index 06a87adb..d0cca2fd 100644 --- a/tools/dbus-send.c +++ b/tools/dbus-send.c @@ -86,11 +86,9 @@ main (int argc, char *argv[]) if (type_str != NULL) { - if (strcmp (type_str, "method_call") == 0) - message_type = DBUS_MESSAGE_TYPE_METHOD_CALL; - else if (strcmp (type_str, "signal") == 0) - message_type = DBUS_MESSAGE_TYPE_SIGNAL; - else + message_type = dbus_message_type_from_string (type_str); + if (!(message_type == DBUS_MESSAGE_TYPE_METHOD_CALL || + message_type == DBUS_MESSAGE_TYPE_SIGNAL)) { fprintf (stderr, "Message type \"%s\" is not supported\n", type_str); -- cgit