summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-09-01 19:04:57 +0200
committerGuillem Jover <guillem@debian.org>2015-09-14 05:44:09 +0200
commit64acb4e4b98d7abe7436d83f0d64f0a3238fe5f3 (patch)
tree671dc19fb74cc7983f67d2a59328a4a2acdbeae1 /src
parent21f5898d846a1cd69bdc6849e2097168cde02fdf (diff)
downloaddpkg-64acb4e4b98d7abe7436d83f0d64f0a3238fe5f3.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/verify.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/verify.c b/src/verify.c
index 28fa84682..e2d087217 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++;