summaryrefslogtreecommitdiff
path: root/lib/verify.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-03-09 10:25:29 +0200
committerPanu Matilainen <pmatilai@redhat.com>2011-03-09 10:30:51 +0200
commitee0ae58b442c5f79967a0d0580144b5c84e0c888 (patch)
tree46f8375303fac84f8ce88da91de98918d52a7947 /lib/verify.c
parent566a15c9c08aa593d05e2f55f1c171a48bc1b1bc (diff)
downloadrpm-ee0ae58b442c5f79967a0d0580144b5c84e0c888.tar.gz
Verify some properties of replaced and wrong-colored files (RhBug:528383)
- We can't verify any properties of replaced files, but we can and should still see if it exists at all. - Files skipped due to wrong color are supposed to share some of the attributes with the file that got actually installed, such as permissions and whether it exists at all. Verify what we can instead of silently ignoring.
Diffstat (limited to 'lib/verify.c')
-rw-r--r--lib/verify.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/verify.c b/lib/verify.c
index 3be357da3..46210bc41 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -70,12 +70,22 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi,
*/
switch (rpmfiFState(fi)) {
case RPMFILE_STATE_NETSHARED:
- case RPMFILE_STATE_REPLACED:
case RPMFILE_STATE_NOTINSTALLED:
- case RPMFILE_STATE_WRONGCOLOR:
case RPMFILE_STATE_MISSING:
return 0;
break;
+ case RPMFILE_STATE_REPLACED:
+ /* For replaced files we can only verify if it exists at all */
+ flags = RPMVERIFY_LSTATFAIL;
+ break;
+ case RPMFILE_STATE_WRONGCOLOR:
+ /*
+ * Files with wrong color are supposed to share some attributes
+ * with the actually installed file - verify what we can.
+ */
+ flags &= ~(RPMVERIFY_FILEDIGEST | RPMVERIFY_FILESIZE |
+ RPMVERIFY_MTIME | RPMVERIFY_RDEV);
+ break;
case RPMFILE_STATE_NORMAL:
break;
}