From ea0275aaeadcffffa00a653c81cc7912aa365eae Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 29 Aug 2018 18:33:01 +0100 Subject: [PATCH] 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 Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739 --- 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 796c25e5b..0bb9e3023 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 abe41fdfa..b04d6db7c 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 c3e81cb29..b9f6d907f 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 a24e74b2a..039a4dec2 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.47.3