summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-10-31 11:29:32 +0200
committerPanu Matilainen <pmatilai@redhat.com>2019-11-18 12:46:29 +0200
commit14d926ae386931dcc9b59f1094a0e65178bfc94e (patch)
tree777202543ea8c10da24334bf9222960a12ee3fda
parentb0c354e642921dfccba535576b7d3c6d895957f9 (diff)
downloadrpm-14d926ae386931dcc9b59f1094a0e65178bfc94e.tar.gz
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)
-rw-r--r--lib/rpmchecksig.c2
-rw-r--r--rpmio/rpmkeyring.c6
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;
}