From 1ed9841f76acbb0c63c272acae8690f9407c8660 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 11 Nov 2019 13:51:30 -0500 Subject: [PATCH] remail/gpg: Allow specifying path to the gpgbinary to use We want to be able to support ECC subkeys, which limits us to gnupg versions 2.2 and above. CentOS-7 ships with gnupg-2.0, which cannot be easily upgraded to 2.2 due to a slew of potential problems, so we install the newer version into /opt/gnupg22 and must call it as /opt/gnupg22/bin/gpg. Allow specifying gpg binary path to use instead of the default "gpg" in $PATH. Signed-off-by: Konstantin Ryabitsev Signed-off-by: Thomas Gleixner --- Documentation/man5/remail.config.rst | 5 +++++ remail/config.py | 1 + remail/gpg.py | 1 + 3 files changed, 7 insertions(+) diff --git a/Documentation/man5/remail.config.rst b/Documentation/man5/remail.config.rst index 8ff71fc..c08dc6b 100644 --- a/Documentation/man5/remail.config.rst +++ b/Documentation/man5/remail.config.rst @@ -211,6 +211,7 @@ GPG options: gpg: always_trust: True sign: True + gpgbinary: gpg always_trust: @@ -228,6 +229,10 @@ GPG options: the public key of the list is not part of the welcome message which is sent to new recipients. + gpgbinary: + + Path to the GnuPG binary to use, defaults to "gpg". + The mailing lists collection: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/remail/config.py b/remail/config.py index 16422d0..a0bf7f8 100644 --- a/remail/config.py +++ b/remail/config.py @@ -211,6 +211,7 @@ class smime_config(object): gpg_defaults = { 'always_trust' : True, 'sign' : True, + 'gpgbinary' : 'gpg', } class gpg_config(object): diff --git a/remail/gpg.py b/remail/gpg.py index be6c033..35cbd42 100644 --- a/remail/gpg.py +++ b/remail/gpg.py @@ -25,6 +25,7 @@ class gpg_crypt(object): self.config = gpgcfg self.account = account self.gpg = gnupg.GPG(gnupghome=self.config.home, + gpgbinary=self.config.gpgbinary, keyring=self.config.keyring) self.keys = self.gpg.list_keys()