diff options
| author | Thomas Fitzsimmons | 2014-11-13 02:43:36 -0500 |
|---|---|---|
| committer | Thomas Fitzsimmons | 2014-11-13 02:43:36 -0500 |
| commit | 9006ccd6c2c0a530b0ec0a341dcaebc8cc70d5f5 (patch) | |
| tree | f5f27cb5ddc8a5a8a07e7b8ff92a89a425bfc738 | |
| parent | 81d0909b70991e95be2993d7793c11a9e8a535ee (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/ldap.el | 20 |
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 @@ | |||
| 1 | 2014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org> | 1 | 2014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org> |
| 2 | 2 | ||
| 3 | * net/ldap.el (ldap-password-read): Handle password-cache being | ||
| 4 | nil. | ||
| 5 | |||
| 6 | 2014-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 |
| 488 | read from the cache, otherwise the user is prompted for the | 488 | read from the cache, otherwise the user is prompted for the |
| 489 | password and the password is cached. The cache can be cleared | 489 | password and the password is cached. The cache can be cleared |
| 490 | with `password-reset`." | 490 | with 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))) | 492 | is 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. |