summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2024-06-18 16:43:53 +0200
committerMichael Albinus <michael.albinus@gmx.de>2024-06-18 16:43:53 +0200
commitce85d3811daea42db78fc1c5bc4a7375ac5e209d (patch)
tree0244a919c8c0c2c2ca322c2430e617056174dcae
parent59261e6f4fef0ec03c8127b29fe107ed19280a3b (diff)
downloademacs-ce85d3811daea42db78fc1c5bc4a7375ac5e209d.tar.gz
emacs-ce85d3811daea42db78fc1c5bc4a7375ac5e209d.tar.bz2
emacs-ce85d3811daea42db78fc1c5bc4a7375ac5e209d.zip
Fix bug#49289 also for other auth-source backends
* lisp/auth-source.el (auth-info-password): Revert commit 59261e6f4fe. (auth-source-secrets-create, auth-source-plstore-create): Search also for :user. (Bug#49289)
-rw-r--r--lisp/auth-source.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 4dcf7d73717..2609541f415 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -874,9 +874,9 @@ while \(:host t) would find all host entries."
(defun auth-info-password (auth-info)
"Return the :secret password from the AUTH-INFO."
(let ((secret (plist-get auth-info :secret)))
- (while (functionp secret)
- (setq secret (funcall secret)))
- secret))
+ (if (functionp secret)
+ (funcall secret)
+ secret)))
(defun auth-source-pick-first-password (&rest spec)
"Pick the first secret found by applying `auth-source-search' to SPEC."
@@ -1698,7 +1698,7 @@ authentication tokens:
items))
(cl-defun auth-source-secrets-create (&rest spec
- &key backend host port create
+ &key backend host port create user
&allow-other-keys)
(let* ((base-required '(host user port secret label))
;; we know (because of an assertion in auth-source-search) that the
@@ -1706,6 +1706,7 @@ authentication tokens:
(create-extra (if (eq t create) nil create))
(current-data (car (auth-source-search :max 1
:host host
+ :user user
:port port)))
(required (append base-required create-extra))
(collection (oref backend source))
@@ -2160,7 +2161,7 @@ entries for git.gnus.org:
items))
(cl-defun auth-source-plstore-create (&rest spec
- &key backend host port create
+ &key backend host port create user
&allow-other-keys)
(let* ((base-required '(host user port secret))
(base-secret '(secret))
@@ -2170,9 +2171,11 @@ entries for git.gnus.org:
(create-extra-secret (plist-get create :encrypted))
(create-extra (if (eq t create) nil
(or (append (plist-get create :unencrypted)
- create-extra-secret) create)))
+ create-extra-secret)
+ create)))
(current-data (car (auth-source-search :max 1
:host host
+ :user user
:port port)))
(required (append base-required create-extra))
(required-secret (append base-secret create-extra-secret))