]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle nil password-cache in ldap-password-read
authorThomas Fitzsimmons <fitzsim@fitzsim.org>
Thu, 13 Nov 2014 07:43:36 +0000 (02:43 -0500)
committerThomas Fitzsimmons <fitzsim@fitzsim.org>
Thu, 13 Nov 2014 07:43:36 +0000 (02:43 -0500)
* net/ldap.el (ldap-password-read): Handle password-cache being
nil.

lisp/ChangeLog
lisp/net/ldap.el

index d395f2e3af605c3a37abbfaa9ef0028ed23220d8..9748fe1fd198931adda3e1d52b4dfe98317490dd 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-13  Thomas Fitzsimmons  <fitzsim@fitzsim.org>
+
+       * net/ldap.el (ldap-password-read): Handle password-cache being
+       nil.
+
 2014-11-13  Thomas Fitzsimmons  <fitzsim@fitzsim.org>
 
        * net/eudc.el (eudc-expand-inline): Always restore former server
index 32e403a87189fce1ccc7b31a0c2a6843e818f4d4..477c21b01454e920cf16b002581e4a363daacfe6 100644 (file)
@@ -487,16 +487,16 @@ Additional search parameters can be specified through
   "Read LDAP password for HOST.  If the password is cached, it is
 read from the cache, otherwise the user is prompted for the
 password and the password is cached.  The cache can be cleared
-with `password-reset`."
-  ;; Add ldap: namespace to allow empty string for default host.
-  (let ((host-key (concat "ldap:" host)))
-    (when (not (password-in-cache-p host-key))
-      (password-cache-add host-key (password-read
-                                   (format "Enter LDAP Password%s: "
-                                           (if (equal host "")
-                                               ""
-                                             (format " for %s" host))))))
-    (password-read-from-cache host-key)))
+with the `password-reset' function and the
+`password-cache-expiry' variable controls how long the password
+is cached for."
+  (password-read-and-add
+   (format "Enter LDAP Password%s: "
+                               (if (equal host "")
+                                   ""
+                                 (format " for %s" host)))
+   ;; Add ldap: namespace to allow empty string for default host.
+   (concat "ldap:" host)))
 
 (defun ldap-search-internal (search-plist)
   "Perform a search on a LDAP server.