emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9006ccd 13/17: Handle nil password-cache in ldap-pa


From: Stefan Monnier
Subject: [Emacs-diffs] master 9006ccd 13/17: Handle nil password-cache in ldap-password-read
Date: Fri, 23 Jan 2015 22:20:35 +0000

branch: master
commit 9006ccd6c2c0a530b0ec0a341dcaebc8cc70d5f5
Author: Thomas Fitzsimmons <address@hidden>
Commit: Thomas Fitzsimmons <address@hidden>

    Handle nil password-cache in ldap-password-read
    
    * net/ldap.el (ldap-password-read): Handle password-cache being
    nil.
---
 lisp/ChangeLog   |    5 +++++
 lisp/net/ldap.el |   20 ++++++++++----------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d395f2e..9748fe1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
 2014-11-13  Thomas Fitzsimmons  <address@hidden>
 
+       * net/ldap.el (ldap-password-read): Handle password-cache being
+       nil.
+
+2014-11-13  Thomas Fitzsimmons  <address@hidden>
+
        * net/eudc.el (eudc-expand-inline): Always restore former server
        and protocol.
 
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 32e403a..477c21b 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]