#1124289 mini-dinstall: regression in GPG keyrings handling

#1124289#5
Date:
2025-12-30 01:43:38 UTC
From:
To:
Dear Maintainer,

Note: the version (0.7.3+nmu2) is a local version I built to workaround the regression.
      It's based on the original 0.7.3 code from Debian

A previous bugfix caused a regression:
* The problematic fix is named "Check GPG keyrings for read access before using them."
  from 23'rd Nov 2023
https://salsa.debian.org/debian/mini-dinstall/-/commit/ad12a309987683f89d7e6ac70defbc38b9d44c81

* The problem is that on line 26, "keyrings_r_ok" is a class variable
  not an object variable.

* As a result, each new instance of "DebianSigVerifier" is
  appending the keyrings names again to the SAME variable.
  This keyring list is ever growing (until restarting the service)

* As a result "gpgv" is run with duplicate GPG keyrings and it fails.
  (no idea why)

* When I discovered this regression:
  - I first tested manual "gpgv" run with the duplicated list and it failed
  - Then I applied locally a stupid (but working) workaround.
    I just removed duplicates before running the "gpgv" program.

* Now I had more time to look in salsa and found the root cause.

* The fix should be simple -- Set and initialize an object (not CLASS) variable
  I.e: "self.keyrings_r_ok = []" in the beginning of "__init__(...)"
       and remove the class variable definition.

#1124289#10
Date:
2026-01-05 12:17:00 UTC
From:
To:
Hi,

The patch is trivial:
 minidinstall/DebianSigVerifier.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minidinstall/DebianSigVerifier.py
b/minidinstall/DebianSigVerifier.py
index 18082d1..8627697 100644
--- a/minidinstall/DebianSigVerifier.py
+++ b/minidinstall/DebianSigVerifier.py
@@ -23,9 +23,9 @@ from .GPGSigVerifier import *

 class DebianSigVerifier(GPGSigVerifier):
     _dpkg_ring = '/etc/dpkg/local-keyring.gpg'
-    keyrings_r_ok = []

     def __init__(self, keyrings=None, extra_keyrings=None):
+        self.keyrings_r_ok = []
         if not keyrings:
             keyrings = ['/usr/share/keyrings/debian-keyring.gpg',
'/usr/share/keyrings/debian-keyring.pgp']
         if os.access(self._dpkg_ring, os.R_OK):