summaryrefslogtreecommitdiffstats
path: root/bus/config-parser.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2008-12-10 14:17:02 -0500
committerColin Walters <walters@verbum.org>2008-12-12 14:00:16 -0500
commitbb2a464067c6843320f367b590b0e4cb00225e50 (patch)
tree51f42dbfa5ee4bcebc667832cf1429036941c63a /bus/config-parser.c
parentb4a75abf8658378934ffd689837c72da2ac22117 (diff)
Add syslog of security denials and configuration file reloads
We need to start logging denials so that they become more easily trackable and debuggable.
Diffstat (limited to 'bus/config-parser.c')
-rw-r--r--bus/config-parser.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 64b8f6f1..4e3be531 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -113,6 +113,8 @@ struct BusConfigParser
unsigned int keep_umask : 1; /**< TRUE to keep original umask when forking */
+ unsigned int syslog : 1; /**< TRUE to enable syslog */
+
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 */
@@ -720,6 +722,21 @@ start_busconfig_child (BusConfigParser *parser,
return TRUE;
}
+ else if (element_type == ELEMENT_SYSLOG)
+ {
+ if (!check_no_attributes (parser, "syslog", attribute_names, attribute_values, error))
+ return FALSE;
+
+ if (push_element (parser, ELEMENT_SYSLOG) == NULL)
+ {
+ BUS_SET_OOM (error);
+ return FALSE;
+ }
+
+ parser->syslog = TRUE;
+
+ return TRUE;
+ }
else if (element_type == ELEMENT_PIDFILE)
{
if (!check_no_attributes (parser, "pidfile", attribute_names, attribute_values, error))
@@ -1984,6 +2001,7 @@ bus_config_parser_end_element (BusConfigParser *parser,
case ELEMENT_DENY:
case ELEMENT_FORK:
case ELEMENT_KEEP_UMASK:
+ case ELEMENT_SYSLOG:
case ELEMENT_SELINUX:
case ELEMENT_ASSOCIATE:
case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
@@ -2271,6 +2289,7 @@ bus_config_parser_content (BusConfigParser *parser,
case ELEMENT_DENY:
case ELEMENT_FORK:
case ELEMENT_KEEP_UMASK:
+ case ELEMENT_SYSLOG:
case ELEMENT_STANDARD_SESSION_SERVICEDIRS:
case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS:
case ELEMENT_ALLOW_ANONYMOUS:
@@ -2601,6 +2620,12 @@ bus_config_parser_get_keep_umask (BusConfigParser *parser)
}
dbus_bool_t
+bus_config_parser_get_syslog (BusConfigParser *parser)
+{
+ return parser->syslog;
+}
+
+dbus_bool_t
bus_config_parser_get_allow_anonymous (BusConfigParser *parser)
{
return parser->allow_anonymous;