aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-09-14 11:49:56 +0200
committerMichael Albinus2016-09-14 11:49:56 +0200
commit8af1763d1f88ad7017eb0deee5e87d2f9fb43fbb (patch)
tree41e976deed20aa3dd6066fce81f7e244ecbcaaaa
parent9345e638f1f1b520aef234f88b2bb16f2323ed88 (diff)
downloademacs-8af1763d1f88ad7017eb0deee5e87d2f9fb43fbb.tar.gz
emacs-8af1763d1f88ad7017eb0deee5e87d2f9fb43fbb.zip
Fix Bug#24432
* lisp/net/tramp-cache.el (tramp-get-hash-table): Initialize a connection as inactive. (tramp-set-connection-property): Make the connection active. (tramp-dump-connection-properties): Don't save "active" property. (tramp-list-connections): List only active connections. (Bug#24432)
-rw-r--r--lisp/net/tramp-cache.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 9a2ff0b099f..2578815ce51 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -99,7 +99,8 @@ matching entries of `tramp-connection-properties'."
99 (or (nth 0 elt) "") 99 (or (nth 0 elt) "")
100 (tramp-make-tramp-file-name 100 (tramp-make-tramp-file-name
101 (aref key 0) (aref key 1) (aref key 2) nil)) 101 (aref key 0) (aref key 1) (aref key 2) nil))
102 (tramp-set-connection-property key (nth 1 elt) (nth 2 elt))))) 102 (tramp-set-connection-property key (nth 1 elt) (nth 2 elt))))
103 (tramp-set-connection-property key "active" 'undef))
103 hash))) 104 hash)))
104 105
105;;;###tramp-autoload 106;;;###tramp-autoload
@@ -262,6 +263,7 @@ KEY is a vector."
262 (aset key 3 nil) 263 (aset key 3 nil)
263 (aset key 4 nil)) 264 (aset key 4 nil))
264 (let ((hash (tramp-get-hash-table key))) 265 (let ((hash (tramp-get-hash-table key)))
266 (puthash "active" t hash)
265 (puthash property value hash) 267 (puthash property value hash)
266 (setq tramp-cache-data-changed t) 268 (setq tramp-cache-data-changed t)
267 (tramp-message key 7 "%s %s" property value) 269 (tramp-message key 7 "%s %s" property value)
@@ -334,14 +336,15 @@ properties of the local machine."
334 (let (result) 336 (let (result)
335 (maphash 337 (maphash
336 (lambda (key _value) 338 (lambda (key _value)
337 (when (and (vectorp key) (null (aref key 3))) 339 (when (and (vectorp key) (null (aref key 3))
340 (tramp-connection-property-p key "active"))
338 (add-to-list 'result key))) 341 (add-to-list 'result key)))
339 tramp-cache-data) 342 tramp-cache-data)
340 result)) 343 result))
341 344
342(defun tramp-dump-connection-properties () 345(defun tramp-dump-connection-properties ()
343 "Write persistent connection properties into file `tramp-persistency-file-name'." 346 "Write persistent connection properties into file `tramp-persistency-file-name'."
344 ;; We shouldn't fail, otherwise (X)Emacs might not be able to be closed. 347 ;; We shouldn't fail, otherwise Emacs might not be able to be closed.
345 (ignore-errors 348 (ignore-errors
346 (when (and (hash-table-p tramp-cache-data) 349 (when (and (hash-table-p tramp-cache-data)
347 (not (zerop (hash-table-count tramp-cache-data))) 350 (not (zerop (hash-table-count tramp-cache-data)))
@@ -359,6 +362,7 @@ properties of the local machine."
359 (not (tramp-file-name-localname key)) 362 (not (tramp-file-name-localname key))
360 (not (gethash "login-as" value))) 363 (not (gethash "login-as" value)))
361 (progn 364 (progn
365 (remhash "active" value)
362 (remhash "process-name" value) 366 (remhash "process-name" value)
363 (remhash "process-buffer" value) 367 (remhash "process-buffer" value)
364 (remhash "first-password-request" value)) 368 (remhash "first-password-request" value))
@@ -368,7 +372,7 @@ properties of the local machine."
368 (with-temp-file tramp-persistency-file-name 372 (with-temp-file tramp-persistency-file-name
369 (insert 373 (insert
370 ";; -*- emacs-lisp -*-" 374 ";; -*- emacs-lisp -*-"
371 ;; `time-stamp-string' might not exist in all (X)Emacs flavors. 375 ;; `time-stamp-string' might not exist in all Emacs flavors.
372 (condition-case nil 376 (condition-case nil
373 (progn 377 (progn
374 (format 378 (format