GNU bug report logs - #29665
26.0.90; auth-source-pass decrypts entries 3 times on query

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "John Wiegley" <johnw@HIDDEN>; dated Mon, 11 Dec 2017 20:25:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 29665 <at> debbugs.gnu.org:


Received: (at 29665) by debbugs.gnu.org; 14 Jul 2019 18:19:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 14 14:19:10 2019
Received: from localhost ([127.0.0.1]:45925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hmj5Z-00011M-MQ
	for submit <at> debbugs.gnu.org; Sun, 14 Jul 2019 14:19:09 -0400
Received: from quimby.gnus.org ([80.91.231.51]:56440)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1hmj5Y-00011B-6c
 for 29665 <at> debbugs.gnu.org; Sun, 14 Jul 2019 14:19:08 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1hmj5U-0004l2-Bx; Sun, 14 Jul 2019 20:19:06 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: 29665 <at> debbugs.gnu.org
Subject: Re: bug#29665: 26.0.90; auth-source-pass decrypts entries 3 times
 on query
References: <m2inddhv3f.fsf@HIDDEN>
Date: Sun, 14 Jul 2019 20:19:04 +0200
In-Reply-To: <m2inddhv3f.fsf@HIDDEN> (John Wiegley's message of "Mon, 
 11 Dec 2017 12:23:48 -0800")
Message-ID: <87pnmcwkbr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: "John Wiegley" <johnw@HIDDEN> writes: > I've enabled
 auth-source-pass
 on my system as follows: > > (use-package auth-source-pass > :config >
 (auth-source-pass-enable)
 > > (defun auth-source-pass--read-entry (entry) > "Return a string with [...]
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 29665
Cc: John Wiegley <johnw@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"John Wiegley" <johnw@HIDDEN> writes:

> I've enabled auth-source-pass on my system as follows:
>
>   (use-package auth-source-pass
>     :config
>     (auth-source-pass-enable)
>   
>     (defun auth-source-pass--read-entry (entry)
>       "Return a string with the file content of ENTRY."
>       (with-temp-buffer
>         (insert-file-contents (expand-file-name
>                                (format "%s.gpg" entry)
>                                (getenv "PASSWORD_STORE_DIR")))
>         (buffer-substring-no-properties (point-min) (point-max))))
>   
>     (defun auth-source-pass-entries ()
>       "Return a list of all password store entries."
>       (let ((store-dir (getenv "PASSWORD_STORE_DIR")))
>         (mapcar
>          (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
>          (directory-files-recursively store-dir "\.gpg$")))))
>
> This works around the other bug I logged today. I have one file in my store:
>
>   ~/doc/.passwords/reddit.com
>
> It has a "login: jwiegley" field. I then run:
>
>   (auth-source-search :host "reddit.com" :user "jwiegley")
>
> After doing so, I can see it Decrypting the reddit.com.gpg file three times
> before it shows me the data, even with `auth-source-do-cache' set to t.

The test case is a bit complicated, but I instrumented the normal
~/.authinfo reading, and it seemed to me that it would only read the
file once when I do the auth-source-search.

Does this work better for you too now?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29665; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Dec 2017 20:24:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 11 15:24:06 2017
Received: from localhost ([127.0.0.1]:57268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eOUcP-00054p-NR
	for submit <at> debbugs.gnu.org; Mon, 11 Dec 2017 15:24:05 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54492)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <johnw@HIDDEN>) id 1eOUcN-00053d-JF
 for submit <at> debbugs.gnu.org; Mon, 11 Dec 2017 15:24:03 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <johnw@HIDDEN>) id 1eOUcH-0001RA-ER
 for submit <at> debbugs.gnu.org; Mon, 11 Dec 2017 15:23:58 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:48276)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <johnw@HIDDEN>) id 1eOUcH-0001QT-BH
 for submit <at> debbugs.gnu.org; Mon, 11 Dec 2017 15:23:57 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45450)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <johnw@HIDDEN>) id 1eOUcG-0003uQ-1N
 for bug-gnu-emacs@HIDDEN; Mon, 11 Dec 2017 15:23:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <johnw@HIDDEN>) id 1eOUcE-0001Ks-VF
 for bug-gnu-emacs@HIDDEN; Mon, 11 Dec 2017 15:23:56 -0500
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45060)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <johnw@HIDDEN>)
 id 1eOUcE-0001Kb-R8; Mon, 11 Dec 2017 15:23:54 -0500
Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:50841)
 by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256)
 (Exim 4.82) (envelope-from <johnw@HIDDEN>)
 id 1eOUcE-0003Hi-Ic; Mon, 11 Dec 2017 15:23:54 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailauth.nyi.internal (Postfix) with ESMTP id 3C33320E5F;
 Mon, 11 Dec 2017 15:23:54 -0500 (EST)
Received: from frontend1 ([10.202.2.160])
 by compute4.internal (MEProxy); Mon, 11 Dec 2017 15:23:54 -0500
X-ME-Sender: <xms:WukuWigjfmq0ctuY0c8MV6APcGitKb7U-OIpD9WXBVvaFTKd0qgWCw>
Received: from localhost (76-234-69-149.lightspeed.frokca.sbcglobal.net
 [76.234.69.149])
 by mail.messagingengine.com (Postfix) with ESMTPA id CC2937FACF;
 Mon, 11 Dec 2017 15:23:53 -0500 (EST)
From: "John Wiegley" <johnw@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.0.90; auth-source-pass decrypts entries 3 times on query
Date: Mon, 11 Dec 2017 12:23:48 -0800
Message-ID: <m2inddhv3f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (darwin)
Mail-Followup-To: bug-gnu-emacs@HIDDEN
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

I've enabled auth-source-pass on my system as follows:

  (use-package auth-source-pass
    :config
    (auth-source-pass-enable)
  
    (defun auth-source-pass--read-entry (entry)
      "Return a string with the file content of ENTRY."
      (with-temp-buffer
        (insert-file-contents (expand-file-name
                               (format "%s.gpg" entry)
                               (getenv "PASSWORD_STORE_DIR")))
        (buffer-substring-no-properties (point-min) (point-max))))
  
    (defun auth-source-pass-entries ()
      "Return a list of all password store entries."
      (let ((store-dir (getenv "PASSWORD_STORE_DIR")))
        (mapcar
         (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
         (directory-files-recursively store-dir "\.gpg$")))))

This works around the other bug I logged today. I have one file in my store:

  ~/doc/.passwords/reddit.com

It has a "login: jwiegley" field. I then run:

  (auth-source-search :host "reddit.com" :user "jwiegley")

After doing so, I can see it Decrypting the reddit.com.gpg file three times
before it shows me the data, even with `auth-source-do-cache' set to t.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Acknowledgement sent to "John Wiegley" <johnw@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#29665; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 14 Jul 2019 18:30:02 UTC

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