aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Fitzsimmons2014-11-13 02:43:36 -0500
committerThomas Fitzsimmons2014-11-13 02:43:36 -0500
commit9006ccd6c2c0a530b0ec0a341dcaebc8cc70d5f5 (patch)
treef5f27cb5ddc8a5a8a07e7b8ff92a89a425bfc738
parent81d0909b70991e95be2993d7793c11a9e8a535ee (diff)
downloademacs-9006ccd6c2c0a530b0ec0a341dcaebc8cc70d5f5.tar.gz
emacs-9006ccd6c2c0a530b0ec0a341dcaebc8cc70d5f5.zip
Handle nil password-cache in ldap-password-read
* net/ldap.el (ldap-password-read): Handle password-cache being nil.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/ldap.el20
2 files changed, 15 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d395f2e3af6..9748fe1fd19 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org> 12014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org>
2 2
3 * net/ldap.el (ldap-password-read): Handle password-cache being
4 nil.
5
62014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org>
7
3 * net/eudc.el (eudc-expand-inline): Always restore former server 8 * net/eudc.el (eudc-expand-inline): Always restore former server
4 and protocol. 9 and protocol.
5 10
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 32e403a8718..477c21b0145 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -487,16 +487,16 @@ Additional search parameters can be specified through
487 "Read LDAP password for HOST. If the password is cached, it is 487 "Read LDAP password for HOST. If the password is cached, it is
488read from the cache, otherwise the user is prompted for the 488read from the cache, otherwise the user is prompted for the
489password and the password is cached. The cache can be cleared 489password and the password is cached. The cache can be cleared
490with `password-reset`." 490with the `password-reset' function and the
491 ;; Add ldap: namespace to allow empty string for default host. 491`password-cache-expiry' variable controls how long the password
492 (let ((host-key (concat "ldap:" host))) 492is cached for."
493 (when (not (password-in-cache-p host-key)) 493 (password-read-and-add
494 (password-cache-add host-key (password-read 494 (format "Enter LDAP Password%s: "
495 (format "Enter LDAP Password%s: " 495 (if (equal host "")
496 (if (equal host "") 496 ""
497 "" 497 (format " for %s" host)))
498 (format " for %s" host)))))) 498 ;; Add ldap: namespace to allow empty string for default host.
499 (password-read-from-cache host-key))) 499 (concat "ldap:" host)))
500 500
501(defun ldap-search-internal (search-plist) 501(defun ldap-search-internal (search-plist)
502 "Perform a search on a LDAP server. 502 "Perform a search on a LDAP server.