New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying of files via \image tag can get confused by symlinks at the destination (Origin: bugzilla #709780) #5310

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.8.5 on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2013-10-10 00:15:04 +0000, Ben Webb wrote:

Created attachment 256863
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.

On 2013-10-12 14:46:03 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next GIT update.

On 2013-12-24 18:59:25 +0000, Dimitri van Heesch wrote:

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).

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment