Package: dpkg
Version: 1.16.0.3
Severity: normal

By default all files in /etc are considered as config files and to be kept on
package upgrade (or ask to user what to do with new config file).

This works excelent for regular files, but can fail if there are two or more
hardlinks to the same file, e. g. if /etc/init.d/script and
/etc/rc2.d/S02script are the same file (latter *is not* a symlink).

I can just guess the reason:
dpkg *moves* old conffile and then tries to create hardlink to file that is not
exists any more.

Synopsis:
root@myhost:~/tmp/bug# dpkg -c ../hardlink-bug_40-0-0_all.deb
drwxr-xr-x root/root         0 2011-08-16 13:10 ./
drwxr-xr-x root/root         0 2011-08-16 13:10 ./etc/
drwxr-xr-x root/root         0 2011-08-16 13:10 ./etc/rc2.d/
-rw-r--r-- root/root        29 2011-08-16 13:10 ./etc/rc2.d/file1
hrw-r--r-- root/root         0 2011-08-16 13:10 ./etc/rc2.d/file2 link to
../etc/rc2.d/file1
drwxr-xr-x root/root         0 2011-08-16 13:10 ./usr/
drwxr-xr-x root/root         0 2011-08-16 13:10 ./usr/share/
drwxr-xr-x root/root         0 2011-08-16 13:10 ./usr/share/doc/
drwxr-xr-x root/root         0 2011-08-16 13:10 ./usr/share/doc/hardlink-bug/
-rw-r--r-- root/root         0 2011-08-16 00:53 ./usr/share/doc/hardlink-
bug/copyright
-rw-r--r-- root/root       153 2011-08-16 00:57 ./usr/share/doc/hardlink-
bug/changelog.Debian.gz
root@myhost:~/tmp/bug# dpkg -i ../hardlink-bug_40-0-0_all.deb
Processing in zone: global
(Reading database ... 108804 files and directories currently installed.)
Preparing to replace hardlink-bug 40-0-0 (using ../hardlink-bug_40-0-0_all.deb)
....
Unpacking replacement hardlink-bug ...
dpkg: error processing ../hardlink-bug_40-0-0_all.deb (--install):
 error creating hard link `./etc/rc2.d/file2': No such file or directory
Errors were encountered while processing:
 ../hardlink-bug_40-0-0_all.deb



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (600, 'unstable'), (550, 'experimental')
Architecture: amd64 (x86_64)

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

Versions of packages dpkg depends on:
ii  coreutils               8.5-1            GNU core utilities
ii  libbz2-1.0              1.0.5-6          high-quality block-sorting file co
ii  libc6                   2.13-10          Embedded GNU C Library: Shared lib
ii  libselinux1             2.0.98-1.1       SELinux runtime shared libraries
ii  xz-utils                5.0.0-2          XZ-format compression utilities
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                           0.8.15.5   Advanced front-end for dpkg

-- no debconf information

Attachment: hardlink-bug.tar.gz
Description: GNU Zip compressed data

Reply via email to