[Reproducible-commits] [dpkg] 20/61: dpkg: Fix --verify with --root
Jérémy Bobbio
lunar at moszumanska.debian.org
Mon Sep 21 09:56:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.
commit 64acb4e4b98d7abe7436d83f0d64f0a3238fe5f3
Author: Guillem Jover <guillem at debian.org>
Date: Tue Sep 1 19:04:57 2015 +0200
dpkg: Fix --verify with --root
The code was not taking into account the root prefix when verifying
pathnames, which resulted in all files failing to verify.
---
debian/changelog | 1 +
src/verify.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index f60ebd6..ace9a74 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ dpkg (1.18.3) UNRELEASED; urgency=low
command instead of executing itself with --set or --auto per subtask.
* Add kfreebsd-armhf support to ostable and triplettable. Closes: #796283
Thanks to Steven Chamberlain <steven at pyro.eu.org>.
+ * Fix «dpkg --verify» with --root.
* Perl modules:
- Only warn on invalid week days instead of aborting in
Dpkg::Changelog::Entry::Debian. Regression introduced in dpkg 1.18.2.
diff --git a/src/verify.c b/src/verify.c
index 28fa846..e2d0872 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -96,6 +96,7 @@ static void
verify_package(struct pkginfo *pkg)
{
struct fileinlist *file;
+ struct varbuf filename = VARBUF_INIT;
ensure_packagefiles_available(pkg);
parse_filehash(pkg, &pkg->installed);
@@ -116,9 +117,14 @@ verify_package(struct pkginfo *pkg)
fnn->newhash = fnn->oldhash;
}
+ varbuf_reset(&filename);
+ varbuf_add_str(&filename, instdir);
+ varbuf_add_str(&filename, fnn->name);
+ varbuf_end_str(&filename);
+
memset(&checks, 0, sizeof(checks));
- md5hash(pkg, hash, fnn->name);
+ md5hash(pkg, hash, filename.buf);
if (strcmp(hash, fnn->newhash) != 0) {
checks.md5sum = VERIFY_FAIL;
failures++;
--
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