From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#40248: 27.0.90; Failure open .authinfo.gpg from Gnus Date: Sat, 28 Mar 2020 10:55:00 +0300 Message-ID: <834ku89anf.fsf@gnu.org> References: <86bloi1zrj.fsf@csic.es> <83lfnm8b30.fsf@gnu.org> <83ftdt9b1d.fsf@gnu.org> <86sght3h1s.fsf@csic.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="90616"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40248@debbugs.gnu.org To: Juan =?UTF-8?Q?Jos=C3=A9_?= =?UTF-8?Q?Garc=C3=ADa-Ripoll?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 28 08:56:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jI6KC-000NRB-3d for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Mar 2020 08:56:12 +0100 Original-Received: from localhost ([::1]:51008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jI6KA-0002JN-Nl for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Mar 2020 03:56:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54922) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jI6K3-0002J9-Id for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 03:56:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jI6K2-0002mS-Gf for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 03:56:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55881) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jI6K2-0002mH-DM for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 03:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jI6K2-0006mS-Ar for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2020 03:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Mar 2020 07:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40248 X-GNU-PR-Package: emacs Original-Received: via spool by 40248-submit@debbugs.gnu.org id=B40248.158538210425972 (code B ref 40248); Sat, 28 Mar 2020 07:56:02 +0000 Original-Received: (at 40248) by debbugs.gnu.org; 28 Mar 2020 07:55:04 +0000 Original-Received: from localhost ([127.0.0.1]:33621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jI6J6-0006kq-Gx for submit@debbugs.gnu.org; Sat, 28 Mar 2020 03:55:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jI6J4-0006kJ-VW for 40248@debbugs.gnu.org; Sat, 28 Mar 2020 03:55:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jI6Iz-0001Xo-Dq; Sat, 28 Mar 2020 03:54:57 -0400 Original-Received: from [176.228.60.248] (port=3298 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jI6Iy-0006t0-Ta; Sat, 28 Mar 2020 03:54:57 -0400 In-Reply-To: <86sght3h1s.fsf@csic.es> (juanjose.garcia.ripoll@csic.es) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177798 Archived-At: > From: Juan José García-Ripoll > > Cc: 40248@debbugs.gnu.org > Date: Fri, 27 Mar 2020 17:21:03 +0100 > > Eli Zaretskii writes: > >> Date: Fri, 27 Mar 2020 11:18:43 +0300 > >> From: Eli Zaretskii > >> Cc: 40248@debbugs.gnu.org > > > > I understand you have some potentially useful backtraces which show > > how epg-find-configuration is improperly called in this case. If so, > > please do provide any information about this you have. > > epg-find-configuration is called via the backtrace below. I have edited > some personal information and domain names. The call chain looks > legit. The problems are in nnimap-open-connection-1 and upwards, where > the read encoding is set to binary. Thanks, that is very useful. Does the patch below give good results, both in your Gnus scenario and when epg-find-configuration is called in other contexts you are aware of and use? Lars, can you or someone of the Gnus team tell why nnimap-open-connection-1 binds coding-system-for-* to 'binary? I don't understand the rationale, as the code which uses this connection seems to expect ASCII text in response. What am I missing? (I tried to find the change(s) which introduced those bindings, but that seems to have been done when Gnus was maintained on a separate Git repository, and the relevant commits aren't visible in the Emacs repository.) diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 74ab651..daa9a5a 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -183,10 +183,18 @@ epg-find-configuration (defun epg-config--make-gpg-configuration (program) (let (config groups type args) (with-temp-buffer - (apply #'call-process program nil (list t nil) nil - (append (if epg-gpg-home-directory - (list "--homedir" epg-gpg-home-directory)) - '("--with-colons" "--list-config"))) + ;; The caller might have bound coding-system-for-* to something + ;; like 'no-conversion, but the below needs to call PROGRAM + ;; expecting human-readable text in both directions (since we + ;; are going to parse the output as text), so let Emacs guess + ;; the encoding of that text by its usual encoding-detection + ;; machinery. + (let ((coding-system-for-read 'undecided) + (coding-system-for-write 'undecided)) + (apply #'call-process program nil (list t nil) nil + (append (if epg-gpg-home-directory + (list "--homedir" epg-gpg-home-directory)) + '("--with-colons" "--list-config")))) (goto-char (point-min)) (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t) (setq type (intern (match-string 1))