GNU bug report logs - #25947
26.0.50; EasyPG does not honor customized epg-gpg-program

Previous Next

Package: emacs;

Reported by: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>

Date: Fri, 3 Mar 2017 11:35:01 UTC

Severity: normal

Found in version 26.0.50

Fixed in version 26.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25947 in the body.
You can then email your comments to 25947 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25947; Package emacs. (Fri, 03 Mar 2017 11:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 03 Mar 2017 11:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; EasyPG does not honor customized epg-gpg-program
Date: Fri, 03 Mar 2017 12:34:03 +0100
Hi there,

I'm experimenting with Emacs on Qubes OS with Split GPG [0], where I
need to redirect invocations of gpg to qubes-gpg-client-wrapper.
However, customizing epg-gpg-program does not work, recipe from
'emacs -Q':

Check value of epg-gpg-program; in my case, I see gpg2:
C-h v epg-gpg-program

Eval the following:
(setq epg-debug t)
(customize-set-variable 'epg-gpg-program "/bin/echo")

Invoke some EasyPG operation, e.g., encrypt a fresh file:
C-x C-f test.gpg

At this point, the debug buffer " *epg-debug*" shows that
/usr/bin/gpg was invoked for decryption.  Note that this is neither
gpg2 (my machine's default) nor /bin/echo (my customization).

Continue:
M-x spook
C-x C-s
A buffer for key selection opens.  It doesn't matter whether I
select a public key (if there is one) or go for symmetric
encryption.  Leave that buffer:
C-c C-c
Enter a Passphrase (e.g., "test") twice in case of symmetric
encryption.

Notice that an encrypted file has been created.
Buffer " *epg-debug*" shows that /usr/bin/gpg was used for
encryption, not /bin/echo.  It doesn't matter whether I use
customize or setq on epg-gpg-program.

As a workaround, I've got the following in my .emacs:
(require 'epg-config)
(setq epg-gpg-program "/usr/bin/qubes-gpg-client-wrapper")
(push (cons 'OpenPGP (epg-config--make-gpg-configuration epg-gpg-program))
      epg--configurations)

Best wishes
Jens


In GNU Emacs 26.0.50 (build 1, x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2017-02-24 built on debian-8
Repository revision: 91932fff1ded8ed3b4d39dd06891f26960153b9e

[0] https://www.qubes-os.org/doc/split-gpg/




Added tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 09 Mar 2017 02:14:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25947; Package emacs. (Thu, 09 Mar 2017 23:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 25947 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>
Cc: 25947 <at> debbugs.gnu.org, Daiki Ueno <ueno <at> unixuser.com>
Subject: Re: bug#25947: 26.0.50;
 EasyPG does not honor customized epg-gpg-program
Date: Thu, 09 Mar 2017 18:26:58 -0500
Jens Lechtenboerger wrote:

> However, customizing epg-gpg-program does not work, recipe from
> 'emacs -Q':
>
> Check value of epg-gpg-program; in my case, I see gpg2:
> C-h v epg-gpg-program
>
> Eval the following:
> (setq epg-debug t)
> (customize-set-variable 'epg-gpg-program "/bin/echo")
>
> Invoke some EasyPG operation, e.g., encrypt a fresh file:
> C-x C-f test.gpg
>
> At this point, the debug buffer " *epg-debug*" shows that
> /usr/bin/gpg was invoked for decryption.  Note that this is neither
> gpg2 (my machine's default) nor /bin/echo (my customization).

Thanks for the report. How about the following:

--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -129,7 +129,8 @@ epg-find-configuration
         (or (and (not no-cache) (alist-get protocol epg--configurations))
             ;; If the executable value is already set with M-x
             ;; customize, use it without checking.
-            (if (and symbol (get symbol 'saved-value))
+            (if (and symbol (or (get symbol 'saved-value)
+                                (get symbol 'customized-value)))
                 (let ((configuration
                        (funcall constructor (symbol-value symbol))))
                   (push (cons protocol configuration) epg--configurations)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25947; Package emacs. (Fri, 10 Mar 2017 15:10:01 GMT) Full text and rfc822 format available.

Message #13 received at 25947 <at> debbugs.gnu.org (full text, mbox):

From: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 25947 <at> debbugs.gnu.org, Daiki Ueno <ueno <at> unixuser.com>
Subject: Re: bug#25947: 26.0.50;
 EasyPG does not honor customized epg-gpg-program
Date: Fri, 10 Mar 2017 16:09:29 +0100
On 2017-03-09, Glenn Morris wrote:

> Thanks for the report. How about the following:
> [...]

Many thanks, this works for me with customize-set-variable.

However, the initial value of epg-gpg-program (gpg2 in my case) is
still ignored.  (So if one wants to stick with the default value,
that does not work.)

Best wishes
Jens




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25947; Package emacs. (Fri, 10 Mar 2017 19:27:02 GMT) Full text and rfc822 format available.

Message #16 received at 25947 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>
Cc: 25947 <at> debbugs.gnu.org, Daiki Ueno <ueno <at> unixuser.com>
Subject: Re: bug#25947: 26.0.50;
 EasyPG does not honor customized epg-gpg-program
Date: Fri, 10 Mar 2017 14:26:38 -0500
Jens Lechtenboerger wrote:

> However, the initial value of epg-gpg-program (gpg2 in my case) is
> still ignored. 

What version of gpg2 do you have?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25947; Package emacs. (Sat, 11 Mar 2017 14:07:02 GMT) Full text and rfc822 format available.

Message #19 received at 25947 <at> debbugs.gnu.org (full text, mbox):

From: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 25947 <at> debbugs.gnu.org, Daiki Ueno <ueno <at> unixuser.com>
Subject: Re: bug#25947: 26.0.50;
 EasyPG does not honor customized epg-gpg-program
Date: Sat, 11 Mar 2017 15:05:49 +0100
On March 10, 2017 8:26:38 PM CET, Glenn Morris <rgm <at> gnu.org> wrote:

>What version of gpg2 do you have?

I wont't have access to that machine before Monday, but I see the issue
elsewhere with gnupg 2.0.22. Apparently, only 2.1 versions are used. 
IMHO, the initialization code for epg-gpg-program should check versions.

Best wishes
Jens




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25947; Package emacs. (Sun, 12 Mar 2017 01:28:01 GMT) Full text and rfc822 format available.

Message #22 received at 25947 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jens Lechtenboerger <lechten <at> wi.uni-muenster.de>
Cc: 25947 <at> debbugs.gnu.org, Daiki Ueno <ueno <at> unixuser.com>
Subject: Re: bug#25947: 26.0.50;
 EasyPG does not honor customized epg-gpg-program
Date: Sat, 11 Mar 2017 20:27:32 -0500
Jens Lechtenboerger wrote:

> On March 10, 2017 8:26:38 PM CET, Glenn Morris <rgm <at> gnu.org> wrote:
>
>>What version of gpg2 do you have?
>
> I wont't have access to that machine before Monday, but I see the issue
> elsewhere with gnupg 2.0.22. Apparently, only 2.1 versions are used. 

Yes, then it's working as intended if you have gpg2 < 2.1.6.

> IMHO, the initialization code for epg-gpg-program should check versions.

This area has been discussed before in eg https://debbugs.gnu.org/24229 .

I've applied the patch I posted earlier to handle the
customize-set-variable issue as cce29d942dc, and will close this report.




Removed tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 12 Mar 2017 01:29:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 25947 <at> debbugs.gnu.org and Jens Lechtenboerger <lechten <at> wi.uni-muenster.de> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 12 Mar 2017 01:29:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 09 Apr 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.