[dpkg] 25/192: dpkg: Fix digest inference for shared conffiles

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:03:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 9507afd811a3d73822dc6a6b110bd602b82aad0b
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Apr 26 19:11:10 2017 +0200

    dpkg: Fix digest inference for shared conffiles
    
    The code in charge of inferring the digest for a conffile was
    checking the owning package status twice, and ignoring conffiles
    with a status lower than "unpacked" even if they had been configured
    previously and their md5sums were valid.
    
    This was causing bogus takeover unpack errors.
    
    Fixes: commit 05a8ddb482419d110571679a29bcd25e3c2b036d
    Closes: #861217
    Stable-Candidate: 1.17.x
---
 debian/changelog | 2 ++
 src/archives.c   | 6 +-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4a5193e..53c4694 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ dpkg (1.18.24) UNRELEASED; urgency=medium
     similar to what dpkg-gencontrol is doing for .deb files.
   * Fix conffile takeover handling during unpack in dpkg on --root or
     on diversions. Closes: #837051, #858004
+  * Fix digest inference for shared conffiles, causing bogus takeover
+    unpack errors. Regression introduced in dpkg 1.16.9. Closes: #861217
   * Architecture support:
     - Add support for ARM64 ILP32. Closes: #824742
       Thanks to Wookey <wookey at wookware.org>.
diff --git a/src/archives.c b/src/archives.c
index b3a678d..b82ee4f 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -228,14 +228,10 @@ md5hash_prev_conffile(struct pkginfo *pkg, char *oldhash, const char *oldname,
   for (otherpkg = &pkg->set->pkg; otherpkg; otherpkg = otherpkg->arch_next) {
     if (otherpkg == pkg)
       continue;
-    /* The hash in the Conffiles is only meaningful if the package
-     * configuration has been at least tried. */
-    if (otherpkg->status < PKG_STAT_UNPACKED)
-      continue;
     /* If we are reinstalling, even if the other package is only unpacked,
      * we can always make use of the Conffiles hash value from an initial
      * installation, if that happened at all. */
-    if (otherpkg->status == PKG_STAT_UNPACKED &&
+    if (otherpkg->status <= PKG_STAT_UNPACKED &&
         dpkg_version_compare(&otherpkg->installed.version,
                              &otherpkg->configversion) != 0)
       continue;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list