From c1960133f77f822cb89fcceb05e298285302b671 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 29 Aug 2018 18:33:01 +0100 Subject: [PATCH 7/9] bus_config_parser_check_doctype: Remove, unused We have never checked the 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 if there is one. (We never validated this particularly strictly anyway; would have been treated as perfectly valid.) Signed-off-by: Simon McVittie --- bus/config-parser-trivial.c | 19 ------------------- bus/config-parser-trivial.h | 3 --- bus/config-parser.c | 19 ------------------- bus/config-parser.h | 3 --- 4 files changed, 44 deletions(-) diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c index 796c25e5..0bb9e302 100644 --- a/bus/config-parser-trivial.c +++ b/bus/config-parser-trivial.c @@ -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, diff --git a/bus/config-parser-trivial.h b/bus/config-parser-trivial.h index abe41fdf..b04d6db7 100644 --- a/bus/config-parser-trivial.h +++ b/bus/config-parser-trivial.h @@ -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, diff --git a/bus/config-parser.c b/bus/config-parser.c index c3e81cb2..b9f6d907 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -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; diff --git a/bus/config-parser.h b/bus/config-parser.h index a24e74b2..039a4dec 100644 --- a/bus/config-parser.h +++ b/bus/config-parser.h @@ -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, -- 2.19.0.rc1