diff options
author | Michael Schroeder <mls@suse.de> | 2010-04-12 12:09:04 +0200 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2010-04-12 12:09:04 +0200 |
commit | cad147070e5513312d851f44998012e8f0cdf1e3 (patch) | |
tree | d2e07ff4c913a66657133165a32394a184267aca /lib | |
parent | 64e7f2aeb4ce01fccacde021fb22c85083284efb (diff) | |
download | librpm-tizen-cad147070e5513312d851f44998012e8f0cdf1e3.tar.gz librpm-tizen-cad147070e5513312d851f44998012e8f0cdf1e3.tar.bz2 librpm-tizen-cad147070e5513312d851f44998012e8f0cdf1e3.zip |
Do not load keyring if signature checking is disabled.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/package.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/package.c b/lib/package.c index d1c73bd94..90e4f9c8a 100644 --- a/lib/package.c +++ b/lib/package.c @@ -760,12 +760,16 @@ exit: rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) { rpmRC rc; - rpmKeyring keyring = rpmtsGetKeyring(ts, 1); rpmVSFlags vsflags = rpmtsVSFlags(ts); + rpmKeyring keyring = 0; + + if ((vsflags & _RPMVSF_NOSIGNATURES) != _RPMVSF_NOSIGNATURES) + keyring = rpmtsGetKeyring(ts, 1); rc = rpmpkgRead(keyring, vsflags, fd, fn, hdrp); - rpmKeyringFree(keyring); + if (keyring) + rpmKeyringFree(keyring); return rc; } |