summaryrefslogtreecommitdiffstats
path: root/bus/config-parser.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-10-10 02:42:21 +0000
committerHavoc Pennington <hp@redhat.com>2003-10-10 02:42:21 +0000
commit6a65f4802e95ba442c520f8e225da837e0a9f73b (patch)
tree734e69da90869b3788d381e75911d720ad8cfd0f /bus/config-parser.c
parent79d03f94fec278d270a33792aeffb33ba239bb01 (diff)
2003-10-09 Havoc Pennington <hp@redhat.com>
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
Diffstat (limited to 'bus/config-parser.c')
-rw-r--r--bus/config-parser.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 7b9b962d..3ff3ec50 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -813,21 +813,6 @@ start_busconfig_child (BusConfigParser *parser,
}
}
-static int
-message_type_from_string (const char *type_str)
-{
- if (strcmp (type_str, "method_call") == 0)
- return DBUS_MESSAGE_TYPE_METHOD_CALL;
- if (strcmp (type_str, "method_return") == 0)
- return DBUS_MESSAGE_TYPE_METHOD_RETURN;
- else if (strcmp (type_str, "signal") == 0)
- return DBUS_MESSAGE_TYPE_SIGNAL;
- else if (strcmp (type_str, "error") == 0)
- return DBUS_MESSAGE_TYPE_ERROR;
- else
- return DBUS_MESSAGE_TYPE_INVALID;
-}
-
static dbus_bool_t
append_rule_from_element (BusConfigParser *parser,
const char *element_name,
@@ -1027,7 +1012,7 @@ append_rule_from_element (BusConfigParser *parser,
message_type = DBUS_MESSAGE_TYPE_INVALID;
if (send_type != NULL)
{
- message_type = message_type_from_string (send_type);
+ message_type = dbus_message_type_from_string (send_type);
if (message_type == DBUS_MESSAGE_TYPE_INVALID)
{
dbus_set_error (error, DBUS_ERROR_FAILED,
@@ -1079,7 +1064,7 @@ append_rule_from_element (BusConfigParser *parser,
message_type = DBUS_MESSAGE_TYPE_INVALID;
if (receive_type != NULL)
{
- message_type = message_type_from_string (receive_type);
+ message_type = dbus_message_type_from_string (receive_type);
if (message_type == DBUS_MESSAGE_TYPE_INVALID)
{
dbus_set_error (error, DBUS_ERROR_FAILED,