From bb2a464067c6843320f367b590b0e4cb00225e50 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 10 Dec 2008 14:17:02 -0500 Subject: Add syslog of security denials and configuration file reloads We need to start logging denials so that they become more easily trackable and debuggable. --- bus/config-parser.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bus/config-parser.c') 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 */ @@ -718,6 +720,21 @@ start_busconfig_child (BusConfigParser *parser, parser->keep_umask = TRUE; + 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) @@ -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: @@ -2600,6 +2619,12 @@ bus_config_parser_get_keep_umask (BusConfigParser *parser) return parser->keep_umask; } +dbus_bool_t +bus_config_parser_get_syslog (BusConfigParser *parser) +{ + return parser->syslog; +} + dbus_bool_t bus_config_parser_get_allow_anonymous (BusConfigParser *parser) { -- cgit