From c8c5f678777d741d01765b90eb7c20d0389577d3 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 13 Oct 2016 23:16:33 +0100 Subject: [PATCH 3/6] Trivial config parser: enumerate the elements we don't care about This quiets -Wswitch-enum warnings. The trivial config parser is used by the setuid activation helper, and only handles the elements whose contents influence the operation of that helper: system service directories, the setuid activation helper itself, the bus uid, and the bus type. [smcv: split out from a larger commit; add justification; move ELEMENT_SERVICEDIR start handler to a functionally equivalent list of elements whose content we are going to process later] Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191 --- bus/config-parser-trivial.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c index 129431d..d085fe7 100644 --- a/bus/config-parser-trivial.c +++ b/bus/config-parser-trivial.c @@ -162,6 +162,7 @@ bus_config_parser_start_element (BusConfigParser *parser, switch (parser->type) { + case ELEMENT_SERVICEDIR: case ELEMENT_SERVICEHELPER: case ELEMENT_USER: case ELEMENT_CONFIGTYPE: @@ -185,6 +186,26 @@ bus_config_parser_start_element (BusConfigParser *parser, break; } + case ELEMENT_NONE: + case ELEMENT_BUSCONFIG: + case ELEMENT_INCLUDE: + case ELEMENT_LISTEN: + case ELEMENT_AUTH: + case ELEMENT_POLICY: + case ELEMENT_LIMIT: + case ELEMENT_ALLOW: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: + case ELEMENT_INCLUDEDIR: + case ELEMENT_SELINUX: + case ELEMENT_ASSOCIATE: + case ELEMENT_STANDARD_SESSION_SERVICEDIRS: + case ELEMENT_KEEP_UMASK: + case ELEMENT_SYSLOG: + case ELEMENT_ALLOW_ANONYMOUS: + case ELEMENT_APPARMOR: + /* fall through */ default: { /* we really don't care about the others... */ @@ -286,6 +307,28 @@ bus_config_parser_content (BusConfigParser *parser, } } break; + + case ELEMENT_NONE: + case ELEMENT_BUSCONFIG: + case ELEMENT_INCLUDE: + case ELEMENT_LISTEN: + case ELEMENT_AUTH: + case ELEMENT_POLICY: + case ELEMENT_LIMIT: + case ELEMENT_ALLOW: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: + case ELEMENT_INCLUDEDIR: + case ELEMENT_SELINUX: + case ELEMENT_ASSOCIATE: + case ELEMENT_STANDARD_SESSION_SERVICEDIRS: + case ELEMENT_STANDARD_SYSTEM_SERVICEDIRS: + case ELEMENT_KEEP_UMASK: + case ELEMENT_SYSLOG: + case ELEMENT_ALLOW_ANONYMOUS: + case ELEMENT_APPARMOR: + /* fall through */ default: { /* we don't care about the others... really */ -- 2.9.3