[dpkg] 24/192: dpkg: Fix conffile takeover handling during unpack on --root or diversions
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 0970c5e5c48d24f5d723f0d0f0c0cec37338b59b
Author: Guillem Jover <guillem at debian.org>
Date: Thu Mar 16 17:20:13 2017 +0100
dpkg: Fix conffile takeover handling during unpack on --root or diversions
The current code was trying to stat(2) a conffile without taking into
account a specified root directory, nor any possible diversions.
But the check based on the device and inode was pretty much unnecessary
because a simple string comparison is enough here, which as a bogus
solves both problems by reducing the code size.
Closes: #837051, #858004
Stable-Candidate: 1.17.x
---
debian/changelog | 2 ++
src/archives.c | 9 +--------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 10b5565..4a5193e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,8 @@ dpkg (1.18.24) UNRELEASED; urgency=medium
that successive runs with different versions and equivalent build types
do not generate multiple .buildinfo entries to be uploaded, which is
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
* 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 074f914..b3a678d 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -875,14 +875,7 @@ tarobject(void *ctx, struct tar_entry *ti)
conff = conff->next) {
if (!conff->obsolete)
continue;
- if (stat(conff->name, &stabtmp)) {
- if (errno == ENOENT || errno == ENOTDIR || errno == ELOOP)
- continue;
- else
- ohshite(_("cannot stat file '%s'"), conff->name);
- }
- if (stabtmp.st_dev == stab.st_dev &&
- stabtmp.st_ino == stab.st_ino)
+ if (strcmp(conff->name, nifd->namenode->name) == 0)
break;
}
if (conff) {
--
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