#808641 doxygen: evalutation of shell expressions in filepaths

Package:
doxygen
Source:
doxygen
Description:
Documentation system for C, C++, Java, Python and other languages
Submitter:
David Kalnischkies
Date:
2015-12-21 16:21:22 UTC
Severity:
minor
#808641#5
Date:
2015-12-21 16:20:26 UTC
From:
To:
Hi,

while playing with strange paths and TMPDIRs I ran across this:

$ LANG=C.UTF-8 doxygen ../build/doc/Doxyfile
sed: can't read /tmp/This is fü22935ing: No such file or directory
sed: can't read crazy, MAN(1)/apt/apt-pkg/acquire-item.cc: No such file or directory
sed: can't read /tmp/This is fü22958ing: No such file or directory
sed: can't read crazy, MAN(1)/apt/apt-pkg/acquire-item.h: No such file or directory
[…]
Error: dot: can't open /tmp/This is fü27628ing
Error: dot: can't open crazy, MAN(1)/apt/build/doc/doxygen/html/graph_legend.dot
Error: dot: can't open crazy, MAN(1)/apt/build/doc/doxygen/html/graph_legend.svg
error: Problems running dot: exit code=4, command='dot', arguments='"/tmp/This is "fü$$ing crazy", $(man man | head -n1 | cut -d' ' -f 1)$!/apt/build/doc/doxygen/html/graph_legend.dot" -Tsvg -o "/tmp/This is "fü$$ing crazy", $(man man | head -n1 | cut -d' ' -f 1)$!/apt/build/doc/doxygen/html/graph_legend.svg"'
[…]
error: Failed to rename file /tmp/This is "fü$$ing crazy", $(man man | head -n1 | cut -d' ' -f 1)$!/apt/build/doc/doxygen/html/dir_18f22d4be2ca84c350e120b6506056ca_dep.svg to /tmp/This is "fü$$ing crazy", $(man man | head -n1 | cut -d' ' -f 1)$!/apt/build/doc/doxygen/html/dir_18f22d4be2ca84c350e120b6506056ca_dep.svg.tmp!

$ echo $?
0

$ pwd
/tmp/This is "fü$$ing crazy", $(man man | head -n1 | cut -d' ' -f 1)$!/apt/doc

You can create this directory with:
mkdir '/tmp/This is "fü$$ing crazy", $(man man | head -n1 | cut -d'"'"' '"'"' -f 1)$!'


On the upside, doxygen seems to have no problem with such a path being
TMPDIR, but if the source it should generate docs for is in such a path
you get the errors above, but doxygen itself doesn't fail and actually
generates documentation – just that it is devoid of most actual content:
Boilerplate stuff expect that it has generated the colorized source
files…

Supporting such paths might be a bit much to ask for (even the generated
./config.status has problems with this path¹), but evaluating it as
shell code might be a bit much as well (see the $$ expansion to the PID
and "MAN(1)") and I think doxygen should exit non-zero if it encounters
such errors, especially as it seems to give up after the first rename
error (the last line shown above) while the others errors are printed
for a lot of files.

This behaviour is the actual reason for the report… I can't nor do
I really feel motivated to report a bug for everything which jumped in
my face while playing with this path as pretty much everything involving
shell at some point finds at least something in it to explode… (which,
frankly, is an appropriate response for such a "psycho-path"), which is
why this report ends up here at doxygen rather than at dot (as it looks
for me like it is dot which is exploding with this path, but I haven't
tried).


Best regards

David Kalnischkies


¹ It gets confused by " as well as ' already. I actually started with
slightly more reasonable paths until I figured out that $$ produces
"fun"… after that the sanity factor hit rock bottom pretty fast. Haven't
tried newlines yet through. I am not *that* crazy… ;)