all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: 29665@debbugs.gnu.org
Cc: John Wiegley <johnw@gnu.org>
Subject: bug#29665: 26.0.90; auth-source-pass decrypts entries 3 times on query
Date: Sun, 14 Jul 2019 20:19:04 +0200	[thread overview]
Message-ID: <87pnmcwkbr.fsf@mouse.gnus.org> (raw)
In-Reply-To: <m2inddhv3f.fsf@newartisans.com> (John Wiegley's message of "Mon,  11 Dec 2017 12:23:48 -0800")

"John Wiegley" <johnw@gnu.org> 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





  reply	other threads:[~2019-07-14 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 20:23 bug#29665: 26.0.90; auth-source-pass decrypts entries 3 times on query John Wiegley
2019-07-14 18:19 ` Lars Ingebrigtsen [this message]
2020-08-12  3:12   ` Stefan Kangas
2020-08-18 13:26     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnmcwkbr.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=29665@debbugs.gnu.org \
    --cc=johnw@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.