summaryrefslogtreecommitdiff
path: root/lib/verify.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2018-01-12 12:07:55 +0200
committerPanu Matilainen <pmatilai@redhat.com>2018-01-12 12:21:03 +0200
commit7013a82d575309be8b7a382fcb5aa57a9f4e4635 (patch)
treebabf38a2960cb382648a8f26206368be5db7a797 /lib/verify.c
parenta76ca4d569f01e58bb7f0b678b7d50ea0626f11a (diff)
downloadrpm-7013a82d575309be8b7a382fcb5aa57a9f4e4635.tar.gz
Fix %ghost/%missingok files causing bogus verify failures (RhBug:1533092)
Looks like a regression on first sight but it's actually just an ancient bug unearthed by commit bb27f9fffa8e557b931314523473ed782b86cc97 - this can only happen now that we actually are verifying %ghosts: %ghost and %missingok files would still cause verify to return an error code although no output for them was shown. It's tempting to filter RPMVERIFY_LSTATFAIL on %ghost/%missingok in rpmfilesVerify() already but then we couldn't report them as missing in verbose mode. So instead just filter them out in verifyHeader() after generating output.
Diffstat (limited to 'lib/verify.c')
-rw-r--r--lib/verify.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/verify.c b/lib/verify.c
index 75f420986..dd92ebdac 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -412,6 +412,11 @@ static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask,
rpmlog(RPMLOG_NOTICE, "%s\n", buf);
buf = _free(buf);
}
+
+ /* Filter out missing %ghost/%missingok errors from final result */
+ if (fileAttrs & (RPMFILE_MISSINGOK|RPMFILE_GHOST))
+ verifyResult &= ~RPMVERIFY_LSTATFAIL;
+
verifyAll |= verifyResult;
}
rpmfiFree(fi);