[Pkg-kde-extras] Bug#732955: exiv2: creates new file in wrong place when old file is a relative symlink

Adam M. Costello bug.amc+6+ at nicemice.net
Mon Dec 23 02:28:14 UTC 2013


Package: exiv2
Version: 0.23-1
Severity: normal

Dear Maintainer,

exiv2 version 0.18.2 fixed a bug related to symlinks, but the fix
introduced two more bugs.

exiv2 is designed to give the illusion of modifying a file in place, but
actually it creates the new file, removes the old file, and renames the
new file to the old name.

The old bug (already fixed): If the file was a symlink, it would become
a plain file, and the file it used to point to would be truncated.

First new bug: If the file is a relative symlink, exiv2 interprets it
relative to the current working directory, rather than relative to the
symlink, when deciding where to create the new file.

Second new bug: If the file is a symlink to another symlink, exiv2
follows only the first.  If the first symlink is relative, the other bug
happens too, otherwise the second symlink gets replaced by a plain file.

The relative-symlink bug is very dangerous, because it can cause an
unrelated file to be removed.  For example, given these files:

foo.jpg
dir/foo.jpg
dir/bar.jpg --> foo.jpg

The command 'exiv2 <options> dir/foo.jpg' will unlink and replace
./foo.jpg, not dir/foo.jpg.

My workaround may provide a hint about how to fix this:

# Assume $@ contains all desired exiv2 options except the filename,
# which is in $file.
file=`readlink -e "$file"`
exiv2 "$@" "$file"

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'stable'), (600, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages exiv2 depends on:
ii  libc6        2.13-38
ii  libexiv2-12  0.23-1
ii  libgcc1      1:4.7.2-5
ii  libstdc++6   4.7.2-5

exiv2 recommends no packages.

exiv2 suggests no packages.

-- no debconf information



More information about the pkg-kde-extras mailing list