Преглед на файлове

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 преди 13 години
родител
ревизия
e2dd70725d
променени са 4 файла, в които са добавени 12 реда и са изтрити 1 реда
  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
     This makes sure to reinclude directories previously excluded so that
     contained files marked for inclusion do not fail to unpack due to a
     contained files marked for inclusion do not fail to unpack due to a
     missing directory. Closes: #688416
     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 ]
   [ Updated programs translations ]
   * Czech (Miroslav Kure).
   * 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)
     if (otherpkg->status <= stat_unpacked)
       continue;
       continue;
     for (conff = otherpkg->installed.conffiles; conff; conff = conff->next) {
     for (conff = otherpkg->installed.conffiles; conff; conff = conff->next) {
+      if (conff->obsolete)
+        continue;
       if (strcmp(conff->name, namenode->name) == 0)
       if (strcmp(conff->name, namenode->name) == 0)
         break;
         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
 		 * version is in the conffiles data for the package. If
 		 * ‘*.dpkg-new’ no longer exists we assume that we've
 		 * ‘*.dpkg-new’ no longer exists we assume that we've
 		 * already processed this one. */
 		 * 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);
 			deferred_configure_conffile(pkg, conff);
+		}
 
 
 		pkg_set_status(pkg, stat_halfconfigured);
 		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));
         pkg_name(pkg, pnaw_always));
   namelen = strlen(file->name);
   namelen = strlen(file->name);
   for (conff= pkg->installed.conffiles; conff; conff= conff->next) {
   for (conff= pkg->installed.conffiles; conff; conff= conff->next) {
+      if (conff->obsolete)
+        continue;
       if (strncmp(file->name, conff->name, namelen) == 0 &&
       if (strncmp(file->name, conff->name, namelen) == 0 &&
           conff->name[namelen] == '/') {
           conff->name[namelen] == '/') {
 	debug(dbg_veryverbose, "directory %s has conffile %s from %s",
 	debug(dbg_veryverbose, "directory %s has conffile %s from %s",