After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709780 - Copying of files via \image tag can get confused by symlinks at the destination
Copying of files via \image tag can get confused by symlinks at the destination
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.5
Other Mac OS
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2013-10-10 00:15 UTC by Ben Webb
Modified: 2013-12-24 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dox.tar.gz (2.94 KB, application/x-gzip)
2013-10-10 00:15 UTC, Ben Webb
Details

Description Ben Webb 2013-10-10 00:15:04 UTC
Created attachment 256863 [details]
dox.tar.gz

The \image tag results in a copy from the input directory to the documentation directory. However, it seems that the copy does not check for an existing file in the documentation directory - if a symlink exists there, it looks like the copy follows the symlink (rather than replacing it) and can get confused.

For example, consider the following input (also in the attachment):

doxygen config, 'dox', the output of 'doxygen -s -g dox' with the following changes:
INPUT                  = inputs
FILE_PATTERNS          = *.c
IMAGE_PATH             = inputs
GENERATE_LATEX         = NO

inputs/test.c containing
/** \file test.c
    \image html foo.png
 */

inputs/foo.png is some image.

Now let's put a symlink (back to the original file) in the HTML output directory:
rm -rf html; mkdir html; ln -sf ../inputs/foo.png html

Then run doxygen: 'doxygen dox' and finally look at the resulting images with 'ls -l */foo.png':
lrwxrwxrwx. 1 ben users 17 Oct  9 17:10 html/foo.png -> ../inputs/foo.png
-rw-r--r--. 1 ben users  0 Oct  9 17:10 inputs/foo.png

Note that the original file, inputs/foo.png, is now 0 bytes. My guess is this is because doxygen followed the symlink and so tried to overwrite the file with itself. Seems like a simple fix would be to simply check if a file exists at the destination before doing the copy, and if it does, remove it.
Comment 1 Dimitri van Heesch 2013-10-12 14:46:03 UTC
Confirmed. Should be fixed in the next GIT update.
Comment 2 Dimitri van Heesch 2013-12-24 18:59:25 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.6. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information 
that you think can be relevant (preferrably in the form of a self-contained example).