Subject: bug#29665: closed (Re: bug#29665: 26.0.90; auth-source-pass decrypts entries 3 times on query)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 18 Aug 2020 13:27:01 +0000

Your bug report

#29665: 26.0.90; auth-source-pass decrypts entries 3 times on query

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
29665: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29665
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#29665: 26.0.90; auth-source-pass decrypts entries 3 times on query
From: Stefan Kangas <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked], John Wiegley <[email-masked]>
Date: Tue, 18 Aug 2020 13:26:48 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Stefan Kangas <[email-masked]> writes:

> No reply here within 12 months.
>
> Yesterday, I accidentally replied individually to Lars only, asking if
> there is more to do here or if this should be closed.  He replied saying
> that it should probably be closed.
>
> Does anyone else have an opinion here?  Otherwise, I'll just go ahead
> and close this.

No further reply within a week, so I'm closing this now.

Best regards,
Stefan Kangas

Subject: 26.0.90; auth-source-pass decrypts entries 3 times on query
From: "John Wiegley" <[email-masked]>
To: [email-masked]
Date: Mon, 11 Dec 2017 12:23:48 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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