Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f1e06f7b
Commit
f1e06f7b
authored
Mar 23, 2014
by
Thierry Volpiatto
Committed by
Michael Albinus
Mar 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* net/tramp.el (tramp-read-passwd): Suspend the timers while reading
the password.
parent
2614c1af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
34 deletions
+47
-34
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/net/tramp.el
lisp/net/tramp.el
+42
-34
No files found.
lisp/ChangeLog
View file @
f1e06f7b
2014-03-23 Thierry Volpiatto <thierry.volpiatto@gmail.com>
* net/tramp.el (tramp-read-passwd): Suspend the timers while reading
the password.
2014-03-23 Dmitry Gutov <dgutov@yandex.ru>
* emacs-lisp/package.el (package-show-package-list): If the buffer
...
...
lisp/net/tramp.el
View file @
f1e06f7b
...
...
@@ -4119,40 +4119,48 @@ Invokes `password-read' if available, `read-passwd' else."
(
with-current-buffer
(
process-buffer
proc
)
(
tramp-check-for-regexp
proc
tramp-password-prompt-regexp
)
(
format
"%s for %s "
(
capitalize
(
match-string
1
))
key
))))
auth-info
auth-passwd
)
(
with-parsed-tramp-file-name
key
nil
(
prog1
(
or
;; See if auth-sources contains something useful, if it's
;; bound. `auth-source-user-or-password' is an obsoleted
;; function, it has been replaced by `auth-source-search'.
(
and
(
boundp
'auth-sources
)
(
tramp-get-connection-property
v
"first-password-request"
nil
)
;; Try with Tramp's current method.
(
if
(
fboundp
'auth-source-search
)
(
setq
auth-info
(
tramp-compat-funcall
'auth-source-search
:max
1
:user
(
or
tramp-current-user
t
)
:host
tramp-current-host
:port
tramp-current-method
)
auth-passwd
(
plist-get
(
nth
0
auth-info
)
:secret
)
auth-passwd
(
if
(
functionp
auth-passwd
)
(
funcall
auth-passwd
)
auth-passwd
))
(
tramp-compat-funcall
'auth-source-user-or-password
"password"
tramp-current-host
tramp-current-method
)))
;; Try the password cache.
(
when
(
functionp
'password-read
)
(
let
((
password
(
tramp-compat-funcall
'password-read
pw-prompt
key
)))
(
tramp-compat-funcall
'password-cache-add
key
password
)
password
))
;; Else, get the password interactively.
(
read-passwd
pw-prompt
))
(
tramp-set-connection-property
v
"first-password-request"
nil
)))))
;; We suspend the timers while reading the password.
(
stimers
(
with-timeout-suspend
))
auth-info
auth-passwd
)
(
unwind-protect
(
with-parsed-tramp-file-name
key
nil
(
prog1
(
or
;; See if auth-sources contains something useful, if
;; it's bound. `auth-source-user-or-password' is an
;; obsoleted function, it has been replaced by
;; `auth-source-search'.
(
and
(
boundp
'auth-sources
)
(
tramp-get-connection-property
v
"first-password-request"
nil
)
;; Try with Tramp's current method.
(
if
(
fboundp
'auth-source-search
)
(
setq
auth-info
(
tramp-compat-funcall
'auth-source-search
:max
1
:user
(
or
tramp-current-user
t
)
:host
tramp-current-host
:port
tramp-current-method
)
auth-passwd
(
plist-get
(
nth
0
auth-info
)
:secret
)
auth-passwd
(
if
(
functionp
auth-passwd
)
(
funcall
auth-passwd
)
auth-passwd
))
(
tramp-compat-funcall
'auth-source-user-or-password
"password"
tramp-current-host
tramp-current-method
)))
;; Try the password cache.
(
when
(
functionp
'password-read
)
(
let
((
password
(
tramp-compat-funcall
'password-read
pw-prompt
key
)))
(
tramp-compat-funcall
'password-cache-add
key
password
)
password
))
;; Else, get the password interactively.
(
read-passwd
pw-prompt
))
(
tramp-set-connection-property
v
"first-password-request"
nil
)))
;; Reenable the timers.
(
with-timeout-unsuspend
stimers
))))
;;;###tramp-autoload
(
defun
tramp-clear-passwd
(
vec
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment