]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Trivial config parser: enumerate the elements we don't care about
authorThomas Zimmermann <tdz@users.sourceforge.net>
Thu, 13 Oct 2016 22:16:33 +0000 (23:16 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 17 Jan 2017 17:20:53 +0000 (17:20 +0000)
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 <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191

bus/config-parser-trivial.c

index 129431daa9a5500a647ef186c5e573cac3a81095..d085fe7f944d36a527c4dc0bf7d2a20462ea8e42 100644 (file)
@@ -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 */