From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add custom variable auth-source-pass-file-extension. Date: Sat, 11 Mar 2023 11:20:42 +0200 Message-ID: <83zg8jwsnp.fsf@gnu.org> References: <20230309163018.20565-1-ngraves@ngraves.fr> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26989"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Nicolas Graves Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 11 10:21:55 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pavQH-0006mB-O6 for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Mar 2023 10:21:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pavPQ-0007pZ-OI; Sat, 11 Mar 2023 04:21:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pavPP-0007pA-9q for emacs-devel@gnu.org; Sat, 11 Mar 2023 04:20:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pavPN-0002Om-J8; Sat, 11 Mar 2023 04:20:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VbFGDDrZkG9jjsY2eDEw/h3QdofEQ+z9rQzixPV3JRQ=; b=GrXyPd3MulY0 E6GqyXr1K3p5U8VeJbgEvCoJU2G2/8xyLwezVOCYVM2gl1sHTB249VwzXdjWXcLKh81dby/d9E6Sb LHoUM6+NAcvDr0PTrEkFC46jq2ZKIhnfwQpKh3usM8rW4f2BJsVO/JrbagUu+NVU1MZE4TpjYBUWW FgBmRCPdPhLNgOIwTcRXbNQ0c3XAXGfkED3BelLct1PNlcnOn4c/zsJsBbDAdnechRCqMz5xtZONM pHEKBsAfKrUl9zJWhpS0IHzURwQvhWu/YBM12OOvKxlZnvA2jRKar4BzBgBxokP5hoSm2Ct2MKLq5 rO92whj3qNGUlw1ggBNsAA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pavPM-0000Jm-RQ; Sat, 11 Mar 2023 04:20:57 -0500 In-Reply-To: <20230309163018.20565-1-ngraves@ngraves.fr> (emacs-devel@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304280 Archived-At: > Cc: ngraves@ngraves.fr > Date: Thu, 9 Mar 2023 17:30:18 +0100 > From: Nicolas Graves via "Emacs development discussions." > > --- > lisp/auth-source-pass.el | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el > index dbcc9d05753..5e232b44438 100644 > --- a/lisp/auth-source-pass.el > +++ b/lisp/auth-source-pass.el > @@ -69,6 +69,11 @@ Unix password store'." > :type 'boolean > :version "29.1") > > +(defcustom auth-source-pass-file-extension "gpg" > + "File extension to expect for auth-source-pass." > + :type 'string > + :version "30.1") > + > (cl-defun auth-source-pass-search (&rest spec > &key backend type host user port > require max > @@ -195,9 +200,10 @@ See `auth-source-pass-get'." > (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) > - auth-source-pass-filename)) > + (insert-file-contents > + (expand-file-name > + (format (concat "%s." auth-source-pass-file-extension) entry) > + auth-source-pass-filename)) > (buffer-substring-no-properties (point-min) (point-max)))) > > (defun auth-source-pass-parse-entry (entry) > @@ -238,7 +244,8 @@ CONTENTS is the contents of a password-store formatted file." > (let ((store-dir (expand-file-name auth-source-pass-filename))) > (mapcar > (lambda (file) (file-name-sans-extension (file-relative-name file store-dir))) > - (directory-files-recursively store-dir "\\.gpg\\'")))) > + (directory-files-recursively > + store-dir (concat "\\." auth-source-pass-file-extension "\\'"))))) > > (defun auth-source-pass--find-match (hosts user port) > "Return password-store entry data matching HOSTS, USER and PORT. > -- > 2.39.2 Thanks, but could you please state the motivation and rationale for this change?