From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#29665: 26.0.90; auth-source-pass decrypts entries 3 times on query Date: Sun, 14 Jul 2019 20:19:04 +0200 Message-ID: <87pnmcwkbr.fsf@mouse.gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="127278"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: John Wiegley To: 29665@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 20:20:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmj6W-000WyM-A3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 20:20:08 +0200 Original-Received: from localhost ([::1]:33656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmj6V-0005Bh-7P for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 14:20:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48073) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmj6S-0005BI-9D for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 14:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmj6R-0005Vk-2O for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 14:20:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmj6Q-0005VX-V3 for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 14:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmj6Q-00012y-Oc for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 14:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2019 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29665 X-GNU-PR-Package: emacs Original-Received: via spool by 29665-submit@debbugs.gnu.org id=B29665.15631283503933 (code B ref 29665); Sun, 14 Jul 2019 18:20:02 +0000 Original-Received: (at 29665) by debbugs.gnu.org; 14 Jul 2019 18:19:10 +0000 Original-Received: from localhost ([127.0.0.1]:45925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmj5Z-00011M-MQ for submit@debbugs.gnu.org; Sun, 14 Jul 2019 14:19:09 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:56440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmj5Y-00011B-6c for 29665@debbugs.gnu.org; Sun, 14 Jul 2019 14:19:08 -0400 Original-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 ) id 1hmj5U-0004l2-Bx; Sun, 14 Jul 2019 20:19:06 +0200 In-Reply-To: (John Wiegley's message of "Mon, 11 Dec 2017 12:23:48 -0800") 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163026 Archived-At: "John Wiegley" 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