GNOME Bugzilla – Bug 501735
xmllint reports failure to load (external) dtds when --nonet specified
Last modified: 2021-07-05 13:21:32 UTC
The same problem as bug#301600, but in libxml2 (I would add it there, but bug is reported against different product): Suppose we have file test.xml: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>.</title></head><body><p>.</p></body> </html> "xmllint --noout --valid test.html" runs with no problem, "xmllint --nonet --noout --valid test.html" fails: I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd test.html:1: warning: failed to load external entity "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" UBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ^ test.html:2: validity error : Validation failed: no DTD found ! <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> By looking into strace xmllint correctly finds /etc/xml/xhtml.xml, opens it and one line reads: <public publicId="-//W3C//DTD XHTML 1.1//EN" uri="file:///usr/share/xml/xhtml/schema/dtd/1.1/xhtml11-flat.dtd"/> But this file is not used, xmllint calls stat("http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd", 0x7fff46ed7190), which of course fails, because http://... is not local file.
downstream bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=344795
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.