GNOME Bugzilla – Bug 125670
"filename" in warning on read error
Last modified: 2021-07-05 11:00:01 UTC
When xsltproc cannot read external entity print a warning like this: warning: failed to load external entity "[<PATH>]foofile.xml" where <PATH> is path to xml file from command line. When we use --path command line options "external entity" can be in other dir. usualy not in <PATH>. It will be good xsltproc never to print <PATH>, but with -v options to show failed read.
Created attachment 20991 [details] testcase
The error MUST be reported. Sorry this is not optionnal, and should not. Catch the errors in your code if you don't want ot print them but the default behaviour is definitely not a bug ! Daniel
Daniel, I would like to reopen bug, because: Let we look output (warnings!) carefully : ======================================================= $ /opt/libxslt/20031027/bin/xsltproc -o test.out --path deny_read xsl/test.xsl xml/test_bad.xml I/O error : Permission denied warning: failed to load external entity "xml/foofile.xml" warning: failed to load external entity "xml/foo_file.xml" $ ls -l deny_read/ total 4.0k --w--w---- 1 ........... foofile.xml ======================================================= Take care about "--path" command line option": xsltproc cannot read "deny_read/foofile.xml" (!) but report "xml/foofile.xml" - that is bug. I don't complain against warning. Wrong is reported "file_name" (exactly "file_path" component of name) in warning ! Might the simplest fix is warning to contain only basename, i.e. file_name without path. ==== Other correct message is like this: warning: failed to load external entity "foofile.xml" from paths "deny_read:xml" ==== I would like to explain my idea for output messages with samples: 1.) verbose mode is off $ .../xsltproc -o test.out --path deny_read xsl/test.xsl xml/test_bad.xml .... warning: failed to load external entity "foofile.xml" ..... 2.) verbose mode is on $ .../xsltproc -v -o test.out --path deny_read xsl/test.xsl xml/test_bad.xml .... I/O error for 'deny_read/foofile.xml': Permission denied warning: failed to load external entity "foofile.xml" ....
Created attachment 21040 [details] testcase with relative paths
Output for test with xml/test_bad1.xml is confusing: I/O error : Permission denied I/O error : Permission denied warning: failed to load external entity "data/foofile.xml"
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/libxslt/-/issues/ Thank you for your understanding and your help.