summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
Diffstat (limited to 'bus')
-rw-r--r--bus/bus.c2
-rw-r--r--bus/config-loader-expat.c3
-rw-r--r--bus/config-parser.c17
-rw-r--r--bus/config-parser.h4
-rw-r--r--bus/system.conf.in5
5 files changed, 22 insertions, 9 deletions
diff --git a/bus/bus.c b/bus/bus.c
index e0f66489..cabc0b18 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -312,7 +312,7 @@ bus_context_new (const DBusString *config_file,
context = NULL;
auth_mechanisms = NULL;
- parser = bus_config_load (config_file, error);
+ parser = bus_config_load (config_file, TRUE, error);
if (parser == NULL)
goto failed;
diff --git a/bus/config-loader-expat.c b/bus/config-loader-expat.c
index 372a8867..3e45166d 100644
--- a/bus/config-loader-expat.c
+++ b/bus/config-loader-expat.c
@@ -164,6 +164,7 @@ expat_CharacterDataHandler (void *userData,
BusConfigParser*
bus_config_load (const DBusString *file,
+ dbus_bool_t is_toplevel,
DBusError *error)
{
XML_Parser expat;
@@ -207,7 +208,7 @@ bus_config_load (const DBusString *file,
goto failed;
}
- parser = bus_config_parser_new (&dirname);
+ parser = bus_config_parser_new (&dirname, is_toplevel);
if (parser == NULL)
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 90f9efd3..d3f482ab 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -109,10 +109,12 @@ struct BusConfigParser
BusPolicy *policy; /**< Security policy */
BusLimits limits; /**< Limits */
-
+
+ char *pidfile; /**< PID file */
+
unsigned int fork : 1; /**< TRUE to fork into daemon mode */
- char *pidfile;
+ unsigned int is_toplevel : 1; /**< FALSE if we are a sub-config-file inside another one */
};
static const char*
@@ -266,7 +268,8 @@ merge_included (BusConfigParser *parser,
}
BusConfigParser*
-bus_config_parser_new (const DBusString *basedir)
+bus_config_parser_new (const DBusString *basedir,
+ dbus_bool_t is_toplevel)
{
BusConfigParser *parser;
@@ -274,6 +277,8 @@ bus_config_parser_new (const DBusString *basedir)
if (parser == NULL)
return NULL;
+ parser->is_toplevel = !!is_toplevel;
+
if (!_dbus_string_init (&parser->basedir))
{
dbus_free (parser);
@@ -1388,7 +1393,7 @@ include_file (BusConfigParser *parser,
DBusError tmp_error;
dbus_error_init (&tmp_error);
- included = bus_config_load (filename, &tmp_error);
+ included = bus_config_load (filename, FALSE, &tmp_error);
if (included == NULL)
{
_DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
@@ -1759,7 +1764,7 @@ bus_config_parser_finished (BusConfigParser *parser,
return FALSE;
}
- if (parser->listen_on == NULL)
+ if (parser->is_toplevel && parser->listen_on == NULL)
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Configuration file needs one or more <listen> elements giving addresses");
@@ -1853,7 +1858,7 @@ do_load (const DBusString *full_path,
dbus_error_init (&error);
- parser = bus_config_load (full_path, &error);
+ parser = bus_config_load (full_path, TRUE, &error);
if (parser == NULL)
{
_DBUS_ASSERT_ERROR_IS_SET (&error);
diff --git a/bus/config-parser.h b/bus/config-parser.h
index acf868ef..eaeafdc5 100644
--- a/bus/config-parser.h
+++ b/bus/config-parser.h
@@ -35,7 +35,8 @@
typedef struct BusConfigParser BusConfigParser;
-BusConfigParser* bus_config_parser_new (const DBusString *basedir);
+BusConfigParser* bus_config_parser_new (const DBusString *basedir,
+ dbus_bool_t is_toplevel);
void bus_config_parser_ref (BusConfigParser *parser);
void bus_config_parser_unref (BusConfigParser *parser);
dbus_bool_t bus_config_parser_check_doctype (BusConfigParser *parser,
@@ -71,6 +72,7 @@ void bus_config_parser_get_limits (BusConfigParser *parser,
* finished ConfigParser.
*/
BusConfigParser* bus_config_load (const DBusString *file,
+ dbus_bool_t is_toplevel,
DBusError *error);
diff --git a/bus/system.conf.in b/bus/system.conf.in
index e65c4af1..d8cd96a8 100644
--- a/bus/system.conf.in
+++ b/bus/system.conf.in
@@ -38,7 +38,12 @@
<allow user="*"/>
</policy>
+ <!-- Config files are placed here that among other things, punch
+ holes in the above policy for specific services. -->
+ <includedir>system.d</includedir>
+
<!-- This is included last so local configuration can override what's
in this standard file -->
<include ignore_missing="yes">system-local.conf</include>
+
</busconfig>