unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: John Wiegley <johnw@gnu.org>
Cc: 29663@debbugs.gnu.org
Subject: bug#29663: 26.0.90; autho-source-pass-entries hardcodes .password-store directory
Date: Sun, 6 Oct 2019 04:07:46 +0200	[thread overview]
Message-ID: <CADwFkmkhzSkAYUmQW9wgmP+h2gT+02jrfqk8vsS2JJs_UnqOUA@mail.gmail.com> (raw)
In-Reply-To: <m2374h6n85.fsf@newartisans.com>

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

"John Wiegley" <johnw@gnu.org> writes:

> `auth-source-pass-entries' is defined as follows:
>
>   (defun auth-source-pass-entries ()
>     "Return a list of all password store entries."
>     (let ((store-dir (expand-file-name "~/.password-store/")))
>       (mapcar
>        (lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
>        (directory-files-recursively store-dir "\.gpg$"))))
>
> However, the pass utility does not require that this be the directory where
> passwords are stored. This should be a customizable variable, initialized from
> the value of (getenv "PASSWORD_STORE_DIR") if set.

Hi John,

I see that an option was added recently which takes care of the first
part of your requesti:

a63cbb56df 2019-01-13 Add auth-source-pass-filename option

I've attached a patch which initializes auth-source-pass-filename to
(getenv "PASSWORD_STORE_DIR") when it's set.  What do you think?

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Use-PASSWORD_STORE_DIR-in-auth-source-pass-when-set.patch --]
[-- Type: text/x-patch, Size: 936 bytes --]

From 2bb16aaa577fe45f7ed18cb84413c53a4c0daea2 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sun, 6 Oct 2019 04:02:27 +0200
Subject: [PATCH] Use PASSWORD_STORE_DIR in auth-source-pass when set

* lisp/auth-source-pass.el (auth-source-pass-filename): Initialize to
PASSWORD_STORE_DIR environment variable when set.  (Bug#29663)
---
 lisp/auth-source-pass.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el
index c45c782c27..524a72792c 100644
--- a/lisp/auth-source-pass.el
+++ b/lisp/auth-source-pass.el
@@ -45,7 +45,8 @@ auth-source-pass
   :group 'auth-source
   :version "27.1")
 
-(defcustom auth-source-pass-filename "~/.password-store"
+(defcustom auth-source-pass-filename
+  (or (getenv "PASSWORD_STORE_DIR") "~/.password-store")
   "Filename of the password-store folder."
   :type 'directory
   :version "27.1")
-- 
2.20.1


  parent reply	other threads:[~2019-10-06  2:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 20:09 bug#29663: 26.0.90; autho-source-pass-entries hardcodes .password-store directory John Wiegley
     [not found] ` <handler.29663.B.151302297517890.ack@debbugs.gnu.org>
2017-12-11 20:21   ` bug#29663: Acknowledgement (26.0.90; autho-source-pass-entries hardcodes .password-store directory) John Wiegley
2019-10-06  2:07 ` Stefan Kangas [this message]
2019-10-07  2:44   ` bug#29663: 26.0.90; autho-source-pass-entries hardcodes .password-store directory Basil L. Contovounesios
2019-11-02  0:34     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CADwFkmkhzSkAYUmQW9wgmP+h2gT+02jrfqk8vsS2JJs_UnqOUA@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=29663@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).