diff -Nru dbus-1.1.20/bus/bus.c dbus-1.1.20/bus/bus.c --- dbus-1.1.20/bus/bus.c 2008-02-26 17:02:27.000000000 +0100 +++ dbus-1.1.20/bus/bus.c 2008-04-07 21:56:05.000000000 +0200 @@ -54,6 +54,7 @@ BusMatchmaker *matchmaker; BusLimits limits; unsigned int fork : 1; + unsigned int allow_anonymous : 1; }; static dbus_int32_t server_data_slot = -1; @@ -188,6 +189,9 @@ dbus_connection_set_max_message_size (new_connection, context->limits.max_message_size); + dbus_connection_set_allow_anonymous (new_connection, + context->allow_anonymous); + /* on OOM, we won't have ref'd the connection so it will die. */ } @@ -384,6 +388,7 @@ } context->fork = bus_config_parser_get_fork (parser); + context->allow_anonymous = bus_config_parser_get_allow_anonymous (parser); _DBUS_ASSERT_ERROR_IS_CLEAR (error); retval = TRUE; diff -Nru /tmp/qwTYSEz495/dbus-1.1.20/bus/config-parser.c /tmp/otIHEd6Wu5/dbus-1.1.20/bus/config-parser.c --- dbus-1.1.20/bus/config-parser.c 2008-02-26 17:02:27.000000000 +0100 +++ dbus-1.1.20/bus/config-parser.c 2008-04-07 21:56:05.000000000 +0200 @@ -112,6 +112,8 @@ unsigned int fork : 1; /**< TRUE to fork into daemon mode */ unsigned int is_toplevel : 1; /**< FALSE if we are a sub-config-file inside another one */ + + unsigned int allow_anonymous : 1; /**< TRUE to allow anonymous connections */ }; static Element* @@ -815,6 +817,20 @@ return TRUE; } + else if (element_type == ELEMENT_ALLOW_ANONYMOUS) + { + if (!check_no_attributes (parser, "allow_anonymous", attribute_names, attribute_values, error)) + return FALSE; + + if (push_element (parser, ELEMENT_ALLOW_ANONYMOUS) == NULL) + { + BUS_SET_OOM (error); + return FALSE; + } + + parser->allow_anonymous = TRUE; + return TRUE; + } else if (element_type == ELEMENT_SERVICEDIR) { if (!check_no_attributes (parser, "servicedir", attribute_names, attribute_values, error)) @@ -1951,6 +1967,7 @@ case ELEMENT_ASSOCIATE: case ELEMENT_STANDARD_SESSION_SERVICEDIRS: case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS: + case ELEMENT_ALLOW_ANONYMOUS: break; } @@ -2234,6 +2251,7 @@ case ELEMENT_FORK: case ELEMENT_STANDARD_SESSION_SERVICEDIRS: case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS: + case ELEMENT_ALLOW_ANONYMOUS: case ELEMENT_SELINUX: case ELEMENT_ASSOCIATE: if (all_whitespace (content)) @@ -2554,6 +2572,12 @@ return parser->fork; } +dbus_bool_t +bus_config_parser_get_allow_anonymous (BusConfigParser *parser) +{ + return parser->allow_anonymous; +} + const char * bus_config_parser_get_pidfile (BusConfigParser *parser) { diff -Nru /tmp/qwTYSEz495/dbus-1.1.20/bus/config-parser-common.c /tmp/otIHEd6Wu5/dbus-1.1.20/bus/config-parser-common.c --- dbus-1.1.20/bus/config-parser-common.c 2008-02-26 17:02:27.000000000 +0100 +++ dbus-1.1.20/bus/config-parser-common.c 2008-04-07 21:56:05.000000000 +0200 @@ -114,6 +114,10 @@ { return ELEMENT_ASSOCIATE; } + else if (strcmp (name, "allow_anonymous") == 0) + { + return ELEMENT_ALLOW_ANONYMOUS; + } return ELEMENT_NONE; } @@ -162,6 +166,8 @@ return "selinux"; case ELEMENT_ASSOCIATE: return "associate"; + case ELEMENT_ALLOW_ANONYMOUS: + return "allow_anonymous"; } _dbus_assert_not_reached ("bad element type"); diff -Nru /tmp/qwTYSEz495/dbus-1.1.20/bus/config-parser-common.h /tmp/otIHEd6Wu5/dbus-1.1.20/bus/config-parser-common.h --- dbus-1.1.20/bus/config-parser-common.h 2008-02-26 17:02:27.000000000 +0100 +++ dbus-1.1.20/bus/config-parser-common.h 2008-04-07 21:56:05.000000000 +0200 @@ -47,7 +47,8 @@ ELEMENT_SELINUX, ELEMENT_ASSOCIATE, ELEMENT_STANDARD_SESSION_SERVICEDIRS, - ELEMENT_STANDARD_SYSTEM_SERVICEDIRS + ELEMENT_STANDARD_SYSTEM_SERVICEDIRS, + ELEMENT_ALLOW_ANONYMOUS } ElementType; ElementType bus_config_parser_element_name_to_type (const char *element_name); diff -Nru /tmp/qwTYSEz495/dbus-1.1.20/bus/config-parser.h /tmp/otIHEd6Wu5/dbus-1.1.20/bus/config-parser.h --- dbus-1.1.20/bus/config-parser.h 2008-02-26 17:02:27.000000000 +0100 +++ dbus-1.1.20/bus/config-parser.h 2008-04-07 21:56:05.000000000 +0200 @@ -65,6 +65,7 @@ DBusList** bus_config_parser_get_addresses (BusConfigParser *parser); DBusList** bus_config_parser_get_mechanisms (BusConfigParser *parser); dbus_bool_t bus_config_parser_get_fork (BusConfigParser *parser); +dbus_bool_t bus_config_parser_get_allow_anonymous (BusConfigParser *parser); const char* bus_config_parser_get_pidfile (BusConfigParser *parser); const char* bus_config_parser_get_servicehelper (BusConfigParser *parser); DBusList** bus_config_parser_get_service_dirs (BusConfigParser *parser);