summaryrefslogtreecommitdiffstats
path: root/bus/config-parser.c
diff options
context:
space:
mode:
authorDennis Kaarsemaker <dennis@kaarsemaker.net>2008-11-12 08:51:00 -0500
committerColin Walters <walters@verbum.org>2008-11-12 08:51:00 -0500
commit07a4ad4b04702fc384b324e5f902a5b2279b0c25 (patch)
tree048adb5d34138fa2b641a0d598d6aee2c3c287d8 /bus/config-parser.c
parente61f13cf328d131ddbd8b49842fcd0f49847dbff (diff)
Bug 15393 - support allow_anonymous config variable
* bus/bus.c: Set allow_anonymous if specified from parser. * bus/config-parser.c: Parse it. * bus/config-parser-common.h: Declare it. Signed-off-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'bus/config-parser.c')
-rw-r--r--bus/config-parser.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 5bb34f17..64b8f6f1 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -114,6 +114,8 @@ struct BusConfigParser
unsigned int keep_umask : 1; /**< TRUE to keep original umask when forking */
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*
@@ -835,6 +837,20 @@ start_busconfig_child (BusConfigParser *parser,
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))
@@ -1972,6 +1988,7 @@ bus_config_parser_end_element (BusConfigParser *parser,
case ELEMENT_ASSOCIATE:
case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
+ case ELEMENT_ALLOW_ANONYMOUS:
break;
}
@@ -2256,6 +2273,7 @@ bus_config_parser_content (BusConfigParser *parser,
case ELEMENT_KEEP_UMASK:
case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
+ case ELEMENT_ALLOW_ANONYMOUS:
case ELEMENT_SELINUX:
case ELEMENT_ASSOCIATE:
if (all_whitespace (content))
@@ -2582,6 +2600,12 @@ bus_config_parser_get_keep_umask (BusConfigParser *parser)
return parser->keep_umask;
}
+dbus_bool_t
+bus_config_parser_get_allow_anonymous (BusConfigParser *parser)
+{
+ return parser->allow_anonymous;
+}
+
const char *
bus_config_parser_get_pidfile (BusConfigParser *parser)
{