bus_config_parser_check_doctype: Remove, unused

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
This commit is contained in:
Simon McVittie 2018-08-29 18:33:01 +01:00
parent 488ed14cc0
commit ea0275aaea
4 changed files with 0 additions and 44 deletions

View 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,

View 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,

View 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;

View 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,