summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-17 10:48:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-17 10:56:29 +0300
commit9209e6cd78a1e6814f3038734cdd300b97ddcf1b (patch)
treed8ade7bed98c321ff49c6a750e7c7b0f39bdfb8c /lib
parent241fc3c143b90cccd47ceb5637542970ef470f25 (diff)
downloadlibrpm-tizen-9209e6cd78a1e6814f3038734cdd300b97ddcf1b.tar.gz
librpm-tizen-9209e6cd78a1e6814f3038734cdd300b97ddcf1b.tar.bz2
librpm-tizen-9209e6cd78a1e6814f3038734cdd300b97ddcf1b.zip
Permit key imports even if signature checking is disabled (RhBug:856225)
- Since commit 290fcbbe6b3ca2fb1d5e4a7269a32a94f8a1563a, key imports on transaction sets where signature checking is disabled would fail due to keyring not getting loaded at all. A regression of sorts, in other words. As a minimal fix, temporarily enable sigcheck vsflags during keyring loading.
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmts.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 765384482..a34edf9a0 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -451,9 +451,15 @@ rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, size_t pktlen
Header h = NULL;
rpmRC rc = RPMRC_FAIL; /* assume failure */
rpmPubkey pubkey = NULL;
- rpmKeyring keyring = rpmtsGetKeyring(ts, 1);
+ rpmVSFlags oflags = rpmtsVSFlags(ts);
+ rpmKeyring keyring;
int krc;
+ /* XXX keyring wont load if sigcheck disabled, force it temporarily */
+ rpmtsSetVSFlags(ts, (oflags & ~_RPMVSF_NOSIGNATURES));
+ keyring = rpmtsGetKeyring(ts, 1);
+ rpmtsSetVSFlags(ts, oflags);
+
if ((pubkey = rpmPubkeyNew(pkt, pktlen)) == NULL)
goto exit;
krc = rpmKeyringAddKey(keyring, pubkey);