Skip to content

Commit

Permalink
Fix rpmKeyringModify with RPMKEYRING_REPLACE
Browse files Browse the repository at this point in the history
We need to both delete the old key and add the new one.
  • Loading branch information
ffesti committed Nov 26, 2024
1 parent 0d5f27e commit 8eff293
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpmio/rpmkeyring.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ int rpmKeyringModify(rpmKeyring keyring, rpmPubkey key, rpmKeyringModifyMode mod
rpmPubkeyFree(item->second);
keyring->keys.erase(item);
rc = 0;
} else if ((item == range.second && mode == RPMKEYRING_ADD) || mode == RPMKEYRING_REPLACE) {
}
if ((item == range.second && mode == RPMKEYRING_ADD) || mode == RPMKEYRING_REPLACE) {
int subkeysCount = 0;
rpmPubkey *subkeys = rpmGetSubkeys(key, &subkeysCount);
keyring->keys.insert({key->keyid, rpmPubkeyLink(key)});
Expand Down

0 comments on commit 8eff293

Please sign in to comment.