summaryrefslogtreecommitdiff
path: root/lib/verify.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-05-28 09:57:09 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-05-28 09:57:09 +0300
commit3f38850609abc97168fb2ba521d6e1923bf80900 (patch)
tree0c93b07a9f4126f5b0d38008fa99824545943811 /lib/verify.c
parentf4bbfed8003ae7c3317a2353fcf36c2768ad6dda (diff)
downloadlibrpm-tizen-3f38850609abc97168fb2ba521d6e1923bf80900.tar.gz
librpm-tizen-3f38850609abc97168fb2ba521d6e1923bf80900.tar.bz2
librpm-tizen-3f38850609abc97168fb2ba521d6e1923bf80900.zip
Only pass the info we actually care about to verifyHeader()
Diffstat (limited to 'lib/verify.c')
-rw-r--r--lib/verify.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/verify.c b/lib/verify.c
index 866ad133f..777617d91 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -281,30 +281,26 @@ static int rpmVerifyScript(rpmts ts, Header h)
/**
* Check file info from header against what's actually installed.
- * @param qva parsed query/verify options
* @param ts transaction set
* @param h header to verify
+ * @param omitMask bits to disable verify checks
+ * @param ghosts should ghosts be verified?
* @return 0 no problems, 1 problems found
*/
-static int verifyHeader(QVA_t qva, const rpmts ts, Header h)
+static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, int ghosts)
{
rpmVerifyAttrs verifyResult = 0;
- /* FIX: union? */
- rpmVerifyAttrs omitMask = ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS);
int ec = 0; /* assume no problems */
- char *buf = NULL;
-
rpmfi fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_FLAGS_VERIFY);
+
rpmfiInit(fi, 0);
while (rpmfiNext(fi) >= 0) {
- rpmfileAttrs fileAttrs;
+ rpmfileAttrs fileAttrs = rpmfiFFlags(fi);
+ char *buf = NULL;
int rc;
- fileAttrs = rpmfiFFlags(fi);
-
/* If not verifying %ghost, skip ghost files. */
- if (!(qva->qva_fflags & RPMFILE_GHOST)
- && (fileAttrs & RPMFILE_GHOST))
+ if ((fileAttrs & RPMFILE_GHOST) && !ghosts)
continue;
rc = rpmVerifyFile(ts, fi, &verifyResult, omitMask);
@@ -420,6 +416,8 @@ static int verifyDependencies(rpmts ts, Header h)
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
{
+ rpmVerifyAttrs omitMask = ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS);
+ int ghosts = (qva->qva_fflags & RPMFILE_GHOST);
int ec = 0;
int rc;
@@ -428,7 +426,7 @@ int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
ec = rc;
}
if (qva->qva_flags & VERIFY_FILES) {
- if ((rc = verifyHeader(qva, ts, h)) != 0)
+ if ((rc = verifyHeader(ts, h, omitMask, ghosts)) != 0)
ec = rc;
}
if (qva->qva_flags & VERIFY_SCRIPT) {