GNU bug report logs - #33040
26.1.50; Epg prompt on Microsoft Windows differ from the GNU/Linux on when asking passphrase

Previous Next

Package: emacs;

Reported by: Pierre Téchoueyres <pierre.techoueyres <at> free.fr>

Date: Sun, 14 Oct 2018 15:55:02 UTC

Severity: minor

Tags: patch

Found in version 26.1.50

Done: Eli Zaretskii <eliz <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 33040 in the body.
You can then email your comments to 33040 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#33040; Package emacs. (Sun, 14 Oct 2018 15:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Téchoueyres <pierre.techoueyres <at> free.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Oct 2018 15:55:02 GMT) Full text and rfc822 format available.

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

From: Pierre Téchoueyres <pierre.techoueyres <at> free.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Sun, 14 Oct 2018 17:53:50 +0200
[Message part 1 (text/plain, inline)]
Hello everyone,
I've noticed an anoying problem when I need to decrypt a file from Emacs
on Windows. The prompt asking my passphrase is two lines whereas on
Gnu/Linux it's only one.

I've tracked this bug down to the epg--start fuction and try the
attached patch from some time now without noticing anything wrong.

The step to reproduce the bug are below:
1) Start Emacs with: emacs -Q
2) Execute the following commands in scratch buffer
   #+BEGIN_SRC emacs-lisp
(require 'epg)
(setq epg-gpg-program "gpg2"
epa-pinentry-mode 'loopback)
;; open a gnupg encrypted file :
(find-file "~/.emacs.d/authinfo.gpg")
   #+END_SRC

The result vary between Emacs on Microsoft windows and on GNU/Linux.

On Microsoft Windows:
#+BEGIN_VERSE
Passphrase for 7F4B4084DFC4EBD2 Pierre Téchoueyres <pierre.techoueyres <at> free.fr>
:
#+END_VERSE
Note the cariage return before the colon.

On GNU/Linux:
#+BEGIN_VERSE
Passphrase for 7F4B4084DFC4EBD2 Pierre Téchoueyres <pierre.techoueyres <at> free.fr>:
#+END_VERSE

[0001-Unify-prompt-for-gnupg-passphrase-between-GNU-Linux-.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Pierre.

Added tag(s) patch. Request was from pierre.techoueyres <at> free.fr (Pierre Téchoueyres) to control <at> debbugs.gnu.org. (Sun, 14 Oct 2018 18:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33040; Package emacs. (Sat, 20 Oct 2018 10:18:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pierre Téchoueyres <pierre.techoueyres <at> free.fr>
Cc: 33040 <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Sat, 20 Oct 2018 13:17:25 +0300
> From: Pierre Téchoueyres <pierre.techoueyres <at> free.fr>
> Date: Sun, 14 Oct 2018 17:53:50 +0200
> 
> diff --git a/lisp/epg.el b/lisp/epg.el
> index 8f26cd34ee..000366d76a 100644
> --- a/lisp/epg.el
> +++ b/lisp/epg.el
> @@ -655,7 +655,9 @@ epg--start
>  				  :command (cons (epg-context-program context)
>  						 args)
>  				  :connection-type 'pipe
> -				  :coding '(binary . binary)
> +				  :coding (if (memq system-type '(ms-dos windows-nt))
> +                                              (cons locale-coding-system locale-coding-system)
> +                                            '(binary . binary))
>  				  :filter #'epg--process-filter
>  				  :stderr error-process
>  				  :noquery t)))

Thanks.

I think a better solution is to use raw-text-unix on both Unix and
DOS/Windows.  Can you try that and see if doing so produces good
results on both systems?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33040; Package emacs. (Wed, 24 Oct 2018 16:56:01 GMT) Full text and rfc822 format available.

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

From: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33040 <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Wed, 24 Oct 2018 18:55:53 +0200
Hello Eli,
I first tried your solution, but that didn't work as expected. Then I
tried using 'raw-text unconditionnaly and everything seems to work as
expected on Microsoft Windows and GNU/Linux.

I do as follow because I think that '(raw-text . raw-text) is the same
as 'raw-text for the :coding keyword.

-				  :coding '(binary . binary)
+				  :coding 'raw-text

Should I prepare an ammended patch ?

Eli Zaretskii <eliz <at> gnu.org> writes:
> Thanks.
>
> I think a better solution is to use raw-text-unix on both Unix and
> DOS/Windows.  Can you try that and see if doing so produces good
> results on both systems?
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33040; Package emacs. (Wed, 24 Oct 2018 17:42:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
Cc: 33040 <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Wed, 24 Oct 2018 20:40:51 +0300
> From: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
> Cc: 33040 <at> debbugs.gnu.org
> Date: Wed, 24 Oct 2018 18:55:53 +0200
> 
> I first tried your solution, but that didn't work as expected. Then I
> tried using 'raw-text unconditionnaly and everything seems to work as
> expected on Microsoft Windows and GNU/Linux.
> 
> I do as follow because I think that '(raw-text . raw-text) is the same
> as 'raw-text for the :coding keyword.
> 
> -				  :coding '(binary . binary)
> +				  :coding 'raw-text
> 
> Should I prepare an ammended patch ?

Doesn't

                                  : coding 'raw-text-unix

work on both Windows and GNU/Linux?  Because I don't really understand
what "unconditionally" means in this context: I didn't suggest using
any conditions.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33040; Package emacs. (Wed, 24 Oct 2018 18:09:01 GMT) Full text and rfc822 format available.

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

From: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33040 <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Wed, 24 Oct 2018 20:08:07 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:
> ...
> Doesn't
>
>                                   : coding 'raw-text-unix
>
> work on both Windows and GNU/Linux?


No it doesn't on Windows. I guess it's because of the -unix part which
results in adding the CR before the colon (:).

> Because I don't really understand
> what "unconditionally" means in this context: I didn't suggest using
> any conditions.

Sorry, when :coding 'raw-text-unix didn't work as expected I first try

:coding (if (memq system-type '(ms-dos windows-nt))
             'raw-text-dos
         'raw-text-unix)

then I realized it was equivalent to :
:coding 'raw-text




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33040; Package emacs. (Wed, 24 Oct 2018 18:36:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
Cc: 33040 <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Wed, 24 Oct 2018 21:35:14 +0300
> From: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
> Cc: 33040 <at> debbugs.gnu.org
> Date: Wed, 24 Oct 2018 20:08:07 +0200
> 
> > Doesn't
> >
> >                                   : coding 'raw-text-unix
> >
> > work on both Windows and GNU/Linux?
> 
> 
> No it doesn't on Windows. I guess it's because of the -unix part which
> results in adding the CR before the colon (:).

Right, I was confused and forgot that this was exactly the original
problem.  So raw-text it is.  And yes, please prepare a patch.

> Sorry, when :coding 'raw-text-unix didn't work as expected I first try
> 
> :coding (if (memq system-type '(ms-dos windows-nt))
>              'raw-text-dos
>          'raw-text-unix)
> 
> then I realized it was equivalent to :
> :coding 'raw-text

Actually, no: it isn't equivalent.  Just raw-text tells Emacs to use
the default on encoding (thus -dos on Windows and -unix on GNU/Linux),
and to _detect_ the EOL format on decoding.  But I don't think this is
a problem in this case, is it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33040; Package emacs. (Wed, 24 Oct 2018 19:22:02 GMT) Full text and rfc822 format available.

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

From: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33040 <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Wed, 24 Oct 2018 21:21:07 +0200
[Message part 1 (text/plain, inline)]
Hello Eli,
please find the patch bellow.
[0001-Unify-prompt-for-gnupg-passphrase-between-GNU-Linux-.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

Eli Zaretskii <eliz <at> gnu.org> writes:
>> Sorry, when :coding 'raw-text-unix didn't work as expected I first try
>> 
>> :coding (if (memq system-type '(ms-dos windows-nt))
>>              'raw-text-dos
>>          'raw-text-unix)
>> 
>> then I realized it was equivalent to :
>> :coding 'raw-text
>
> Actually, no: it isn't equivalent.  Just raw-text tells Emacs to use
> the default on encoding (thus -dos on Windows and -unix on GNU/Linux),
> and to _detect_ the EOL format on decoding.  But I don't think this is
> a problem in this case, is it?
>

No, it isn't a problem, and on the contrary it's exactly what I want :
detect the EOL format for decoding.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 27 Oct 2018 09:39:01 GMT) Full text and rfc822 format available.

Notification sent to Pierre Téchoueyres <pierre.techoueyres <at> free.fr>:
bug acknowledged by developer. (Sat, 27 Oct 2018 09:39:02 GMT) Full text and rfc822 format available.

Message #30 received at 33040-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
Cc: 33040-done <at> debbugs.gnu.org
Subject: Re: bug#33040: 26.1.50;
 Epg prompt on Microsoft Windows differ from the GNU/Linux on when
 asking passphrase
Date: Sat, 27 Oct 2018 12:38:07 +0300
> From: pierre.techoueyres <at> free.fr (Pierre Téchoueyres)
> Cc: 33040 <at> debbugs.gnu.org
> Date: Wed, 24 Oct 2018 21:21:07 +0200
> 
> Hello Eli,
> please find the patch bellow.

Thanks, pushed to the release branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 24 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 266 days ago.

Previous Next


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