[xml/sgml-pkgs] Bug#845552: libxml2: Error when resolving relative URLs in XML catalogs, resulting in "file:/..." URLs

Matthias Pigulla mp at webfactory.de
Thu Nov 24 15:01:58 UTC 2016

Package: libxml2
Version: 2.9.1+dfsg1-5+deb8u3
Severity: important

The 0034-xmlSaveUri-incorrectly-recomposes-URIs-with-rootless.patch patch
was added back in 2.9.1+dfsg1-4, probably following the bug report at

This patch, however, caused additional issues:

The first one was addressed in
c6c5cfd126f25. As far as I can tell, this change has not yet been

Second, the change caused a break with resolution of relative URLs, see
https://mail.gnome.org/archives/xml/2016-November/msg00012.html. The
result is that when using the default DTDs as provided by, for example,
the w3c-dtd-xhtml package, libxml will construct invalid URLs like
"file:/usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-strict.dtd". This is
missing two "//" slashes in the beginning. libxml will wrongly interpret
this URL (including the file: prefix!) as a local file path and fail
during catalog resolution.

The error message typically would be something like

failed to load external entity
"file:/usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-strict.dtd" in Entity,
line ...

A simple check is to run the testURI command which is contained in/build
by libxml:

./testURI --base file:///some/where file

Result without patch: file:/some/file
Result with patch: file:///some/file


- Cherry pick 
- Additionally, apply the attached patch


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://lists.alioth.debian.org/pipermail/debian-xml-sgml-pkgs/attachments/20161124/8eca19aa/attachment.txt>

More information about the debian-xml-sgml-pkgs mailing list