Copy the string received from auth-source

The SASL library likes to erase the string, so make sure it doesn't
erase the cached string.
This commit is contained in:
Magnus Henoch 2013-04-11 13:50:04 +01:00
parent c98be9e194
commit 27ef29a7a2
1 changed files with 4 additions and 3 deletions

View File

@ -317,9 +317,10 @@ If FULLJIDS is non-nil, complete jids with resources."
:require '(:secret))))))
(if found
(let ((secret (plist-get found :secret)))
(if (functionp secret)
(funcall secret)
secret))
(copy-sequence
(if (functionp secret)
(funcall secret)
secret)))
(let ((prompt (format "Jabber password for %s: " bare-jid)))
(if (require 'password-cache nil t)
;; Need to copy the password, as sasl.el wants to erase it.