From 2f3cdb851e58953f1dbcc23425764645237404f7 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Fri, 12 Mar 2004 20:25:34 +0000 Subject: [PATCH] * main/remove.c (removal_bulk_remove_configfiles): Don't change the "previous pointer" pointer if we remove the node from the linked list, ensuring that if the next node is to be removed the right thing will happen. This corrects the bug where every second shared or diverted conffile would be incorrectly deleted by dpkg. --- ChangeLog | 10 ++++++++++ debian/changelog | 4 ++++ main/remove.c | 5 ++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 596aa2a6..1e9425de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Fri Mar 12 19:02:21 GMT 2004 Scott James Remnant + + * main/remove.c (removal_bulk_remove_configfiles): Don't change the + "previous pointer" pointer if we remove the node from the linked list, + ensuring that if the next node is to be removed the right thing will + happen. + + This corrects the bug where every second shared or diverted conffile + would be incorrectly deleted by dpkg. + Fri Mar 12 15:05:52 GMT 2004 Scott James Remnant * utils/start-stop-daemon.c: Don't require an argument for -V (version). diff --git a/debian/changelog b/debian/changelog index a913ebaa..58b23e6c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ dpkg (1.10.21) unstable; urgency=low * Don't require argument for start-stop-daemon -V. Closes: #237589. + * Fix incorrect linked list node removal code that caused every second + shared or diverted conffile to be deleted by dpkg. + Closes: #10879, #33046, #47267, #90623, #98210, #109691, #146167. + Closes: #155456, #204275. -- Scott James Remnant UNRELEASED diff --git a/main/remove.c b/main/remove.c index c40f219c..0337ddb5 100644 --- a/main/remove.c +++ b/main/remove.c @@ -403,9 +403,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { * are involved in diversions, except if we are the package doing the * diverting. */ - for (lconffp= &pkg->installed.conffiles; - (conff= *lconffp) != 0; - lconffp= &conff->next) { + for (lconffp= &pkg->installed.conffiles; (conff= *lconffp) != 0; ) { for (searchfile= pkg->clientdata->files; searchfile && strcmp(searchfile->namenode->name,conff->name); searchfile= searchfile->next); @@ -422,6 +420,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { } else { debug(dbg_conffdetail,"removal_bulk set to new conffile `%s'",conff->name); conff->hash= NEWCONFFILEFLAG; /* yes, cast away const */ + lconffp= &conff->next; } } modstatdb_note(pkg); -- 2.39.5