]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus_config_parser_check_doctype: Remove, unused
authorSimon McVittie <smcv@collabora.com>
Wed, 29 Aug 2018 17:33:01 +0000 (18:33 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 30 Aug 2018 16:39:38 +0000 (17:39 +0100)
We have never checked the <!DOCTYPE> of busconfig XML since the libxml
parser was removed in 2013, and the libxml parser was broken before
that anyway. The recommended Expat parser (our only parser since 2013)
does not appear to have ever validated this, so now does not seem like
the time to start. Just ignore the <!DOCTYPE> if there is one.

(We never validated this particularly strictly anyway;
<!DOCTYPE busconfig SYSTEM "http://example.com/bees"> would have been
treated as perfectly valid.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

bus/config-parser-trivial.c
bus/config-parser-trivial.h
bus/config-parser.c
bus/config-parser.h

index 796c25e5b302a1383ad848929d6e82202e095df3..0bb9e30233c0cde3b746a25ef139263b2c9185bb 100644 (file)
@@ -126,25 +126,6 @@ bus_config_parser_unref (BusConfigParser *parser)
   dbus_free (parser);
 }
 
-dbus_bool_t
-bus_config_parser_check_doctype (BusConfigParser   *parser,
-                                 const char        *doctype,
-                                 DBusError         *error)
-{
-  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
-  if (strcmp (doctype, "busconfig") != 0)
-    {
-      dbus_set_error (error,
-                      DBUS_ERROR_FAILED,
-                      "Configuration file has the wrong document type %s",
-                      doctype);
-      return FALSE;
-    }
-  else
-    return TRUE;
-}
-
 dbus_bool_t
 bus_config_parser_start_element (BusConfigParser   *parser,
                                  const char        *element_name,
index abe41fdfa3a2ced42c1175a0450aadaa74bda222..b04d6db7c0c804f2815d2133488e4deb6842ecd9 100644 (file)
@@ -39,9 +39,6 @@ BusConfigParser* bus_config_parser_new (const DBusString      *basedir,
 
 BusConfigParser* bus_config_parser_ref           (BusConfigParser   *parser);
 void             bus_config_parser_unref         (BusConfigParser   *parser);
-dbus_bool_t      bus_config_parser_check_doctype (BusConfigParser   *parser,
-                                                  const char        *doctype,
-                                                  DBusError         *error);
 dbus_bool_t      bus_config_parser_start_element (BusConfigParser   *parser,
                                                   const char        *element_name,
                                                   const char       **attribute_names,
index c3e81cb29403228c4497bee8d6e928037a9efa5e..b9f6d907f6f854ca03273b21ac9b3e56e99d4183 100644 (file)
@@ -604,25 +604,6 @@ bus_config_parser_unref (BusConfigParser *parser)
     }
 }
 
-dbus_bool_t
-bus_config_parser_check_doctype (BusConfigParser   *parser,
-                                 const char        *doctype,
-                                 DBusError         *error)
-{
-  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
-  if (strcmp (doctype, "busconfig") != 0)
-    {
-      dbus_set_error (error,
-                      DBUS_ERROR_FAILED,
-                      "Configuration file has the wrong document type %s",
-                      doctype);
-      return FALSE;
-    }
-  else
-    return TRUE;
-}
-
 typedef struct
 {
   const char  *name;
index a24e74b2ab2c8ff5158bfebe7c7dfb4ba2849531..039a4dec293f259852529518f30b26782df888a9 100644 (file)
@@ -40,9 +40,6 @@ BusConfigParser* bus_config_parser_new (const DBusString      *basedir,
 
 BusConfigParser* bus_config_parser_ref           (BusConfigParser   *parser);
 void             bus_config_parser_unref         (BusConfigParser   *parser);
-dbus_bool_t      bus_config_parser_check_doctype (BusConfigParser   *parser,
-                                                  const char        *doctype,
-                                                  DBusError         *error);
 dbus_bool_t      bus_config_parser_start_element (BusConfigParser   *parser,
                                                   const char        *element_name,
                                                   const char       **attribute_names,