Explorar o código

dpkg: Do not consider obsolete conffiles as actively owned by the package

This ensures conffile entries are not misshandled nor mixed up when
configuring packages owning the non-obsolete conffiles. Otherwise we
end up with bogus entries in the database, which could cause unpack
failures, leftover directories on removal or wrong processing of
conffiles.

Closes: #689836

Based-on-patch-by: Andreas Beckmann <debian@abeckmann.de>
Signed-off-by: Guillem Jover <guillem@debian.org>
Guillem Jover %!s(int64=13) %!d(string=hai) anos
pai
achega
e2dd70725d
Modificáronse 4 ficheiros con 12 adicións e 1 borrados
  1. 4 0
      debian/changelog
  2. 2 0
      src/archives.c
  3. 4 1
      src/configure.c
  4. 2 0
      src/help.c

+ 4 - 0
debian/changelog

@@ -31,6 +31,10 @@ dpkg (1.16.9) UNRELEASED; urgency=low
     This makes sure to reinclude directories previously excluded so that
     contained files marked for inclusion do not fail to unpack due to a
     missing directory. Closes: #688416
+  * Do not consider obsolete conffiles as actively owned by the package.
+    This ensures conffile entries are not misshandled nor mixed up when
+    configuring packages owning the non-obsolete conffiles. Closes: #689836
+    Based on a patch by Andreas Beckmann <debian@abeckmann.de>.
 
   [ Updated programs translations ]
   * Czech (Miroslav Kure).

+ 2 - 0
src/archives.c

@@ -197,6 +197,8 @@ md5hash_prev_conffile(struct pkginfo *pkg, char *oldhash, const char *oldname,
     if (otherpkg->status <= stat_unpacked)
       continue;
     for (conff = otherpkg->installed.conffiles; conff; conff = conff->next) {
+      if (conff->obsolete)
+        continue;
       if (strcmp(conff->name, namenode->name) == 0)
         break;
     }

+ 4 - 1
src/configure.c

@@ -391,8 +391,11 @@ deferred_configure(struct pkginfo *pkg)
 		 * version is in the conffiles data for the package. If
 		 * ‘*.dpkg-new’ no longer exists we assume that we've
 		 * already processed this one. */
-		for (conff = pkg->installed.conffiles; conff; conff = conff->next)
+		for (conff = pkg->installed.conffiles; conff; conff = conff->next) {
+			if (conff->obsolete)
+				continue;
 			deferred_configure_conffile(pkg, conff);
+		}
 
 		pkg_set_status(pkg, stat_halfconfigured);
 	}

+ 2 - 0
src/help.c

@@ -218,6 +218,8 @@ dir_has_conffiles(struct filenamenode *file, struct pkginfo *pkg)
         pkg_name(pkg, pnaw_always));
   namelen = strlen(file->name);
   for (conff= pkg->installed.conffiles; conff; conff= conff->next) {
+      if (conff->obsolete)
+        continue;
       if (strncmp(file->name, conff->name, namelen) == 0 &&
           conff->name[namelen] == '/') {
 	debug(dbg_veryverbose, "directory %s has conffile %s from %s",