[Pkg-phototools-devel] Bug#752294: optipng -backup loses .bak symlink when the target doesn't exist

Vincent Lefevre vincent at vinc17.net
Sun Jun 22 09:44:43 UTC 2014


Package: optipng
Version: 0.7.5-1
Severity: normal

When using the -backup option, if the .bak file is a symbolic link
pointing to a non-existing target, OptiPNG 0.7.5 transforms this
symbolic link to a normal file, losing the symbolic link itself.

This can be reproduced with:

------------------------------------------------------------------
#!/bin/sh

prefix=symlinktest.$$

base64 -d > $prefix.1.png <<EOF
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAQAAAACkhYXAAAAABGdBTUEAALGPC/xhBQAAAAFzUkdC
AK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dE
AAHdihOkAAAACW9GRnMAAAEfAAACiQBnGPpYAAAACXBIWXMAAABgAAAAYADwa0LPAAAACXZwQWcA
AAH1AAADKACp4S7kAAAADElEQVQI12NgGFkAAADwAAHXt5aiAAAAJXRFWHRkYXRlOmNyZWF0ZQAy
MDE0LTA2LTIyVDExOjE0OjQyKzAyOjAw2bjiaQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0wNi0y
MlQxMToxNDo0MiswMjowMKjlWtUAAAAZdEVYdFNvZnR3YXJlAGdub21lLXNjcmVlbnNob3TvA78+
AAAAAElFTkSuQmCC
EOF

cp $prefix.1.png $prefix.2.png
touch $prefix.3.png
ln -s $prefix.3.png $prefix.1.png.bak
rm -f $prefix.4.png
ln -s $prefix.4.png $prefix.2.png.bak

ls -l $prefix.*
optipng -backup $prefix.1.png
optipng -backup $prefix.2.png
ls -l $prefix.*

rm $prefix.*
------------------------------------------------------------------

I get, for instance:

-rw-r--r-- 1 vinc17 vinc17 354 2014-06-22 11:34:19 symlinktest.31986.1.png
lrwxrwxrwx 1 vinc17 vinc17  23 2014-06-22 11:34:19 symlinktest.31986.1.png.bak -> symlinktest.31986.3.png
-rw-r--r-- 1 vinc17 vinc17 354 2014-06-22 11:34:19 symlinktest.31986.2.png
lrwxrwxrwx 1 vinc17 vinc17  23 2014-06-22 11:34:19 symlinktest.31986.2.png.bak -> symlinktest.31986.4.png
-rw-r--r-- 1 vinc17 vinc17   0 2014-06-22 11:34:19 symlinktest.31986.3.png
[...]
-rw-r--r-- 1 vinc17 vinc17 354 2014-06-22 11:34:19 symlinktest.31986.1.png
lrwxrwxrwx 1 vinc17 vinc17  23 2014-06-22 11:34:19 symlinktest.31986.1.png.bak -> symlinktest.31986.3.png
-rw-r--r-- 1 vinc17 vinc17 353 2014-06-22 11:34:19 symlinktest.31986.2.png
-rw-r--r-- 1 vinc17 vinc17 354 2014-06-22 11:34:19 symlinktest.31986.2.png.bak
-rw-r--r-- 1 vinc17 vinc17   0 2014-06-22 11:34:19 symlinktest.31986.3.png

One can see that the symlinktest.31986.2.png.bak target information
has been lost.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages optipng depends on:
ii  libc6       2.19-3
ii  libpng12-0  1.2.50-1
ii  zlib1g      1:1.2.8.dfsg-1

optipng recommends no packages.

optipng suggests no packages.

-- no debconf information



More information about the Pkg-phototools-devel mailing list