From 14d926ae386931dcc9b59f1094a0e65178bfc94e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 31 Oct 2019 11:29:32 +0200 Subject: Resurrect --prtpkts debug switch functionality Move the _print_pkts global to librpmio where the two relevant users can actually access it, and make them use it. This has been broken for years... (cherry picked from commit d609a426f66d3868b50bcd3a2038fb264fd2ab40) --- lib/rpmchecksig.c | 2 -- rpmio/rpmkeyring.c | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 30af7f641..06db14c17 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -24,8 +24,6 @@ #include "debug.h" -int _print_pkts = 0; - static int doImport(rpmts ts, const char *fn, char *buf, ssize_t blen) { char const * const pgpmark = "-----BEGIN PGP "; diff --git a/rpmio/rpmkeyring.c b/rpmio/rpmkeyring.c index bea04ff4b..4fb01ecae 100644 --- a/rpmio/rpmkeyring.c +++ b/rpmio/rpmkeyring.c @@ -13,6 +13,8 @@ #include "debug.h" +int _print_pkts = 0; + struct rpmPubkey_s { uint8_t *pkt; size_t pktlen; @@ -227,7 +229,7 @@ pgpDig rpmPubkeyDig(rpmPubkey key) dig = pgpNewDig(); pthread_rwlock_rdlock(&key->lock); - rc = pgpPrtPkts(key->pkt, key->pktlen, dig, 0); + rc = pgpPrtPkts(key->pkt, key->pktlen, dig, _print_pkts); pthread_rwlock_unlock(&key->lock); if (rc == 0) { @@ -302,7 +304,7 @@ rpmRC rpmKeyringLookup(rpmKeyring keyring, pgpDig sig) * on (successful) return, sigh. No need to check for return * here as this is validated at rpmPubkeyNew() already. */ - pgpPrtPkts(key->pkt, key->pktlen, sig, 0); + pgpPrtPkts(key->pkt, key->pktlen, sig, _print_pkts); res = RPMRC_OK; } -- cgit v1.2.1