summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKeith Amidon <camalot@picnicpark.org>2019-02-14 10:27:31 -0800
committerDamien Cassou <damien@cassou.me>2019-06-24 09:15:40 +0200
commit94c9eb81b8b265380345c36c0a481d9022435d89 (patch)
tree2903d5a21119fa80efd9f5c48073dc09155286c3 /lisp
parent2a0a05789d4734e4b3d18941346ecda9834e7cc9 (diff)
downloademacs-94c9eb81b8b265380345c36c0a481d9022435d89.tar.gz
Fix auth-source-pass to search for hostname:port/username
auth-source-pass supports entries with username either prefixed to the hostname with an @ as separator or in a subdirectory under the hostname. This was true when there was no port or service included in the name, but got broken with the introduction of auth-source-pass-port-separator. * lisp/auth-source-pass.el (auth-source-pass--find-match-unambiguous): Fix to match hostname:port/username. * test/lisp/auth-source-pass-tests.el: Add corresponding tests.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/auth-source-pass.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el
index 626dbf842c1..4aa0853be94 100644
--- a/lisp/auth-source-pass.el
+++ b/lisp/auth-source-pass.el
@@ -262,6 +262,9 @@ HOSTNAME should not contain any username or port number."
(and user port (auth-source-pass--find-one-by-entry-name
(format "%s@%s%s%s" user hostname auth-source-pass-port-separator port)
user))
+ (and user port (auth-source-pass--find-one-by-entry-name
+ (format "%s%s%s" hostname auth-source-pass-port-separator port)
+ user))
(and user (auth-source-pass--find-one-by-entry-name
(format "%s@%s" user hostname)
user))