[Rpm-maint] [rpm-software-management/rpm] Implement a separate lock for the keystore (PR #4123)

Michal Domonkos notifications at github.com
Tue Apr 21 15:19:23 UTC 2026


@dmnks commented on this pull request.



> @@ -370,15 +389,18 @@ rpmRC rpmtxnImportPubkey(rpmtxn txn, const unsigned char * pkt, size_t pktlen)
 
 exit:
     /* Clean up. */
+    if (txn != kxn)
+	rpmtxnEnd(txn);

Hmm. So we grab a keystore handle (`rpmkxnBegin()`) at the beginning of the function *if* the passed one (`txn`) is incorrectly a transaction handle.

Therefore, we should also close the *keystore* handle at the end (if we did grab it, which is the `txn != kxn` check above), thus this should be `rpmkxnEnd(txn)`, no? 🤔 

> @@ -396,24 +418,30 @@ rpmRC rpmtxnDeletePubkey(rpmtxn txn, rpmPubkey key)
 	}
 	rc = RPMRC_OK;
 	rpmKeyringFree(keyring);
+	if (kxn != txn)
+	    rpmtxnEnd(txn);

Same as above

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4123?email_source=notifications&email_token=ADLPZUYL53XFVY2LLE7IQNT4W6GPXA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMJUHA4DCNBXGYZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS6XA4S7OJSXM2LFO5PW433UNFTGSY3BORUW63TTL5RWY2LDNM#pullrequestreview-4148814763
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4123/review/4148814763 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260421/6fcc5f14/attachment.htm>


More information about the Rpm-maint mailing list