diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-05-28 10:49:58 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-05-28 10:49:58 +0300 |
commit | a6c8e490236bc373fcb565d30652f69218db2b84 (patch) | |
tree | 3208d56626fe9836ff58992b021d3c66beaa694b | |
parent | be1c4872c1fb3e196beddde2c415ed2a009dfe32 (diff) | |
download | rpm-a6c8e490236bc373fcb565d30652f69218db2b84.tar.gz rpm-a6c8e490236bc373fcb565d30652f69218db2b84.tar.bz2 rpm-a6c8e490236bc373fcb565d30652f69218db2b84.zip |
Move shared file timestamp filtering out of rpmVerifyFile()
- rpmVerifyFile() reports things as they are in reality - if timestamps
on disk differ to header then it reports it. Filtering on the result
belongs to the code interpreting the results.
-rw-r--r-- | lib/verify.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/verify.c b/lib/verify.c index 777617d91..904802112 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -232,11 +232,7 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, #endif if ((flags & RPMVERIFY_MTIME) && (sb.st_mtime != rpmfiFMtime(fi))) { - /* Filter out timestamp differences of shared files */ - rpmdbMatchIterator mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, fn, 0); - if (rpmdbGetIteratorCount(mi) < 2) - *res |= RPMVERIFY_MTIME; - rpmdbFreeIterator(mi); + *res |= RPMVERIFY_MTIME; } if (flags & RPMVERIFY_USER) { @@ -304,6 +300,16 @@ static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, int ghosts) continue; rc = rpmVerifyFile(ts, fi, &verifyResult, omitMask); + + /* Filter out timestamp differences of shared files */ + if (rc == 0 && (verifyResult & RPMVERIFY_MTIME)) { + rpmdbMatchIterator mi; + mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, rpmfiFN(fi), 0); + if (rpmdbGetIteratorCount(mi) > 1) + verifyResult &= ~RPMVERIFY_MTIME; + rpmdbFreeIterator(mi); + } + if (rc) { if (!(fileAttrs & (RPMFILE_MISSINGOK|RPMFILE_GHOST)) || rpmIsVerbose()) { rasprintf(&buf, _("missing %c %s"), |