From 9209e6cd78a1e6814f3038734cdd300b97ddcf1b Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 17 Sep 2012 10:48:05 +0300 Subject: [PATCH] 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. --- lib/rpmts.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/rpmts.c b/lib/rpmts.c index 7653844..a34edf9 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); -- 2.7.4