diff options
author | jbj <devnull@localhost> | 2002-07-24 16:21:23 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-07-24 16:21:23 +0000 |
commit | ede1f445e09895daee8bce8a2ddc9200839ee5de (patch) | |
tree | 66738dfcfd86d2c355b5f2ead53fb556999c2e71 /lib/rpmts.c | |
parent | 6540da425629bf45020047214b81e156c62c7d7b (diff) | |
download | librpm-tizen-ede1f445e09895daee8bce8a2ddc9200839ee5de.tar.gz librpm-tizen-ede1f445e09895daee8bce8a2ddc9200839ee5de.tar.bz2 librpm-tizen-ede1f445e09895daee8bce8a2ddc9200839ee5de.zip |
- verify signatures/digests retrieved through rpmdbNextIterator().
- imbue %ghost with missingok attribute with --verify (#68933).
CVS patchset: 5568
CVS date: 2002/07/24 16:21:23
Diffstat (limited to 'lib/rpmts.c')
-rw-r--r-- | lib/rpmts.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c index c7bc4a78b..86919ec7e 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -138,12 +138,36 @@ int rpmtsOpenDB(rpmts ts, int dbmode) return rc; } +int rpmtsInitDB(rpmts ts, int dbmode) +{ + return rpmdbInit(ts->rootDir, dbmode); +} + +int rpmtsRebuildDB(rpmts ts) +{ + int rc; + if (!(ts->vsflags & _RPMTS_VSF_NOHDRCHK)) + rc = rpmdbRebuild(ts->rootDir, ts, headerCheck); + else + rc = rpmdbRebuild(ts->rootDir, NULL, NULL); + return rc; +} + +int rpmtsVerifyDB(rpmts ts) +{ + return rpmdbVerify(ts->rootDir); +} + rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, const void * keyp, size_t keylen) { + rpmdbMatchIterator mi; if (ts->rdb == NULL && rpmtsOpenDB(ts, ts->dbmode)) return NULL; - return rpmdbInitIterator(ts->rdb, rpmtag, keyp, keylen); + mi = rpmdbInitIterator(ts->rdb, rpmtag, keyp, keylen); + if (mi && !(ts->vsflags & _RPMTS_VSF_NOHDRCHK)) + (void) rpmdbSetHdrChk(mi, ts, headerCheck); + return mi; } rpmVerifySignatureReturn rpmtsFindPubkey(rpmts ts) @@ -171,9 +195,6 @@ rpmVerifySignatureReturn rpmtsFindPubkey(rpmts ts) ts->pkpktlen = 0; memset(ts->pksignid, 0, sizeof(ts->pksignid)); - /* Make sure the database is open. */ - (void) rpmtsOpenDB(ts, ts->dbmode); - /* Retrieve the pubkey that matches the signature. */ mi = rpmtsInitIterator(ts, RPMTAG_PUBKEYS, sigp->signid, sizeof(sigp->signid)); while ((h = rpmdbNextIterator(mi)) != NULL) { |