diff options
| author | Kai Großjohann | 2004-07-17 17:28:43 +0000 |
|---|---|---|
| committer | Kai Großjohann | 2004-07-17 17:28:43 +0000 |
| commit | 07dfe73898a43069d9d85ef74978e3fc9509773a (patch) | |
| tree | 3e68668614e89c8ae71c17fad2263a6e30408f3b | |
| parent | 3e39672fd35c40e1dedc8213858a3ac424a31824 (diff) | |
| download | emacs-07dfe73898a43069d9d85ef74978e3fc9509773a.tar.gz emacs-07dfe73898a43069d9d85ef74978e3fc9509773a.zip | |
Sync with Tramp 2.0.43.
(tramp-handle-verify-visited-file-modtime): Remove
outdated comment.
(tramp-locked, tramp-locker): New variables for implementing a
global lock.
(tramp-sh-file-name-handler): Use them to implement the global
lock.
| -rw-r--r-- | lisp/ChangeLog | 39 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-vc.el | 18 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 203 | ||||
| -rw-r--r-- | man/trampver.texi | 2 |
5 files changed, 172 insertions, 92 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf0600b7605..f508879cb01 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,42 @@ | |||
| 1 | 2004-07-17 Kai Grossjohann <kai.grossjohann@gmx.net> | ||
| 2 | |||
| 3 | Sync with Tramp 2.0.43. | ||
| 4 | |||
| 5 | * net/tramp.el (tramp-handle-verify-visited-file-modtime): Remove | ||
| 6 | outdated comment. | ||
| 7 | (tramp-locked, tramp-locker): New variables for implementing a | ||
| 8 | global lock. | ||
| 9 | (tramp-sh-file-name-handler): Use them to implement the global | ||
| 10 | lock. | ||
| 11 | |||
| 12 | 2004-07-13 Michael Albinus <michael.albinus@gmx.de> | ||
| 13 | |||
| 14 | * net/tramp.el (all): Code cleanup. Change all `tramp-handle-xxx' | ||
| 15 | calls to respective `xxx` calls. | ||
| 16 | (tramp-process-alive-regexp): Precise doc string. | ||
| 17 | (tramp-multi-action-process-alive): New defun. | ||
| 18 | (tramp-multi-actions): Use it. | ||
| 19 | (tramp-handle-find-backup-file-name): `copy-tree' is available | ||
| 20 | since Emacs 21.4 only (XEmacs has it). Implementation rewritten | ||
| 21 | in order to avoid this function. | ||
| 22 | (tramp-handle-write-region): Set current buffer. If connection | ||
| 23 | wasn't open, `file-modes' has changed it accidently. Reported by | ||
| 24 | David Kastrup <dak@gnu.org>. | ||
| 25 | (tramp-enter-password, tramp-read-passwd): New arguments USER and | ||
| 26 | HOST. | ||
| 27 | (tramp-action-password, tramp-multi-action-password): Apply it. | ||
| 28 | (tramp-open-connection-rsh): If a port is given, the Tramp buffer | ||
| 29 | name must still contain the port number. Otherwise, we have two | ||
| 30 | Tramp buffers, with all the confusion. Reported by Myron Selby | ||
| 31 | <myron@xytech.com> and Rolf Dubitzky | ||
| 32 | <Dubitzky@physi.uni-heidelberg.de>. | ||
| 33 | |||
| 34 | * net/tramp-smb.el (tramp-smb-open-connection): Apply USER and | ||
| 35 | HOST to `tramp-enter-passwd'. | ||
| 36 | |||
| 37 | * net/tramp-vc.el (all): Code cleanup. Change all | ||
| 38 | `tramp-handle-xxx' calls to respective `xxx` calls. | ||
| 39 | |||
| 1 | 2004-07-17 Jonathan Yavner <jyavner@member.fsf.org> | 40 | 2004-07-17 Jonathan Yavner <jyavner@member.fsf.org> |
| 2 | 41 | ||
| 3 | * emacs-lisp/testcover.el: New category "potentially-1valued" for | 42 | * emacs-lisp/testcover.el: New category "potentially-1valued" for |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index cca01d169b6..6a888d9d75d 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -1012,7 +1012,7 @@ Domain names in USER and port numbers in HOST are acknowledged." | |||
| 1012 | (when real-user | 1012 | (when real-user |
| 1013 | (let ((pw-prompt "Password:")) | 1013 | (let ((pw-prompt "Password:")) |
| 1014 | (tramp-message 9 "Sending password") | 1014 | (tramp-message 9 "Sending password") |
| 1015 | (tramp-enter-password p pw-prompt))) | 1015 | (tramp-enter-password p pw-prompt user host))) |
| 1016 | 1016 | ||
| 1017 | (unless (tramp-smb-wait-for-output user host) | 1017 | (unless (tramp-smb-wait-for-output user host) |
| 1018 | (tramp-clear-passwd user host) | 1018 | (tramp-clear-passwd user host) |
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el index 839a8702dd9..e720deb8f07 100644 --- a/lisp/net/tramp-vc.el +++ b/lisp/net/tramp-vc.el | |||
| @@ -77,7 +77,7 @@ | |||
| 77 | "Like `vc-do-command' but invoked for tramp files. | 77 | "Like `vc-do-command' but invoked for tramp files. |
| 78 | See `vc-do-command' for more information." | 78 | See `vc-do-command' for more information." |
| 79 | (save-match-data | 79 | (save-match-data |
| 80 | (and file (setq file (tramp-handle-expand-file-name file))) | 80 | (and file (setq file (expand-file-name file))) |
| 81 | (if (not buffer) (setq buffer "*vc*")) | 81 | (if (not buffer) (setq buffer "*vc*")) |
| 82 | (if vc-command-messages | 82 | (if vc-command-messages |
| 83 | (message "Running `%s' on `%s'..." command file)) | 83 | (message "Running `%s' on `%s'..." command file)) |
| @@ -85,7 +85,7 @@ See `vc-do-command' for more information." | |||
| 85 | (squeezed nil) | 85 | (squeezed nil) |
| 86 | (olddir default-directory) | 86 | (olddir default-directory) |
| 87 | vc-file status) | 87 | vc-file status) |
| 88 | (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) | 88 | (let* ((v (tramp-dissect-file-name (expand-file-name file))) |
| 89 | (multi-method (tramp-file-name-multi-method v)) | 89 | (multi-method (tramp-file-name-multi-method v)) |
| 90 | (method (tramp-file-name-method v)) | 90 | (method (tramp-file-name-method v)) |
| 91 | (user (tramp-file-name-user v)) | 91 | (user (tramp-file-name-user v)) |
| @@ -130,7 +130,7 @@ See `vc-do-command' for more information." | |||
| 130 | (save-excursion | 130 | (save-excursion |
| 131 | (save-window-excursion | 131 | (save-window-excursion |
| 132 | ;; Actually execute remote command | 132 | ;; Actually execute remote command |
| 133 | (tramp-handle-shell-command | 133 | (shell-command |
| 134 | (mapconcat 'tramp-shell-quote-argument | 134 | (mapconcat 'tramp-shell-quote-argument |
| 135 | (cons command squeezed) " ") t) | 135 | (cons command squeezed) " ") t) |
| 136 | ;;(tramp-wait-for-output) | 136 | ;;(tramp-wait-for-output) |
| @@ -190,7 +190,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." | |||
| 190 | (let ((w32-quote-process-args t)) | 190 | (let ((w32-quote-process-args t)) |
| 191 | (when (eq okstatus 'async) | 191 | (when (eq okstatus 'async) |
| 192 | (message "Tramp doesn't do async commands, running synchronously.")) | 192 | (message "Tramp doesn't do async commands, running synchronously.")) |
| 193 | (setq status (tramp-handle-shell-command | 193 | (setq status (shell-command |
| 194 | (mapconcat 'tramp-shell-quote-argument | 194 | (mapconcat 'tramp-shell-quote-argument |
| 195 | (cons command squeezed) " ") t)) | 195 | (cons command squeezed) " ") t)) |
| 196 | (when (or (not (integerp status)) | 196 | (when (or (not (integerp status)) |
| @@ -257,7 +257,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." | |||
| 257 | ;; Don't switch to the *vc-info* buffer before running the | 257 | ;; Don't switch to the *vc-info* buffer before running the |
| 258 | ;; command, because that would change its default directory | 258 | ;; command, because that would change its default directory |
| 259 | (save-match-data | 259 | (save-match-data |
| 260 | (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) | 260 | (let* ((v (tramp-dissect-file-name (expand-file-name file))) |
| 261 | (multi-method (tramp-file-name-multi-method v)) | 261 | (multi-method (tramp-file-name-multi-method v)) |
| 262 | (method (tramp-file-name-method v)) | 262 | (method (tramp-file-name-method v)) |
| 263 | (user (tramp-file-name-user v)) | 263 | (user (tramp-file-name-user v)) |
| @@ -284,7 +284,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." | |||
| 284 | (save-excursion | 284 | (save-excursion |
| 285 | (save-window-excursion | 285 | (save-window-excursion |
| 286 | ;; Actually execute remote command | 286 | ;; Actually execute remote command |
| 287 | (tramp-handle-shell-command | 287 | (shell-command |
| 288 | (mapconcat 'tramp-shell-quote-argument | 288 | (mapconcat 'tramp-shell-quote-argument |
| 289 | (append (list command) args (list localname)) " ") | 289 | (append (list command) args (list localname)) " ") |
| 290 | (get-buffer-create"*vc-info*")) | 290 | (get-buffer-create"*vc-info*")) |
| @@ -414,7 +414,7 @@ filename we are thinking about..." | |||
| 414 | (nth 2 (file-attributes file))))) | 414 | (nth 2 (file-attributes file))))) |
| 415 | (if (and uid (/= uid remote-uid)) | 415 | (if (and uid (/= uid remote-uid)) |
| 416 | (error "tramp-handle-vc-user-login-name cannot map a uid to a name") | 416 | (error "tramp-handle-vc-user-login-name cannot map a uid to a name") |
| 417 | (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) | 417 | (let* ((v (tramp-dissect-file-name (expand-file-name file))) |
| 418 | (u (tramp-file-name-user v))) | 418 | (u (tramp-file-name-user v))) |
| 419 | (cond ((stringp u) u) | 419 | (cond ((stringp u) u) |
| 420 | ((vectorp u) (elt u (1- (length u)))) | 420 | ((vectorp u) (elt u (1- (length u)))) |
| @@ -445,8 +445,8 @@ filename we are thinking about..." | |||
| 445 | (defun tramp-file-owner (filename) | 445 | (defun tramp-file-owner (filename) |
| 446 | "Return who owns FILE (user name, as a string)." | 446 | "Return who owns FILE (user name, as a string)." |
| 447 | (let ((v (tramp-dissect-file-name | 447 | (let ((v (tramp-dissect-file-name |
| 448 | (tramp-handle-expand-file-name filename)))) | 448 | (expand-file-name filename)))) |
| 449 | (if (not (tramp-handle-file-exists-p filename)) | 449 | (if (not (file-exists-p filename)) |
| 450 | nil ; file cannot be opened | 450 | nil ; file cannot be opened |
| 451 | ;; file exists, find out stuff | 451 | ;; file exists, find out stuff |
| 452 | (save-excursion | 452 | (save-excursion |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d9a8d14309a..7f04a948811 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -916,8 +916,8 @@ The answer will be provided by `tramp-action-terminal', which see." | |||
| 916 | "Regular expression indicating a process has finished. | 916 | "Regular expression indicating a process has finished. |
| 917 | In fact this expression is empty by intention, it will be used only to | 917 | In fact this expression is empty by intention, it will be used only to |
| 918 | check regularly the status of the associated process. | 918 | check regularly the status of the associated process. |
| 919 | The answer will be provided by `tramp-action-process-alive' and | 919 | The answer will be provided by `tramp-action-process-alive', |
| 920 | `tramp-action-out-of-band', which see." | 920 | `tramp-multi-action-process-alive' and`tramp-action-out-of-band', which see." |
| 921 | :group 'tramp | 921 | :group 'tramp |
| 922 | :type 'regexp) | 922 | :type 'regexp) |
| 923 | 923 | ||
| @@ -1321,7 +1321,7 @@ See `tramp-actions-before-shell' for more info." | |||
| 1321 | (shell-prompt-pattern tramp-multi-action-succeed) | 1321 | (shell-prompt-pattern tramp-multi-action-succeed) |
| 1322 | (tramp-shell-prompt-pattern tramp-multi-action-succeed) | 1322 | (tramp-shell-prompt-pattern tramp-multi-action-succeed) |
| 1323 | (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied) | 1323 | (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied) |
| 1324 | (tramp-process-alive-regexp tramp-action-process-alive)) | 1324 | (tramp-process-alive-regexp tramp-multi-action-process-alive)) |
| 1325 | "List of pattern/action pairs. | 1325 | "List of pattern/action pairs. |
| 1326 | This list is used for each hop in multi-hop connections. | 1326 | This list is used for each hop in multi-hop connections. |
| 1327 | See `tramp-actions-before-shell' for more info." | 1327 | See `tramp-actions-before-shell' for more info." |
| @@ -2165,7 +2165,7 @@ target of the symlink differ." | |||
| 2165 | (let ((nonnumeric (and id-format (equal id-format 'string))) | 2165 | (let ((nonnumeric (and id-format (equal id-format 'string))) |
| 2166 | result) | 2166 | result) |
| 2167 | (with-parsed-tramp-file-name filename nil | 2167 | (with-parsed-tramp-file-name filename nil |
| 2168 | (when (tramp-handle-file-exists-p filename) | 2168 | (when (file-exists-p filename) |
| 2169 | ;; file exists, find out stuff | 2169 | ;; file exists, find out stuff |
| 2170 | (save-excursion | 2170 | (save-excursion |
| 2171 | (if (tramp-get-remote-perl multi-method method user host) | 2171 | (if (tramp-get-remote-perl multi-method method user host) |
| @@ -2509,19 +2509,19 @@ if the remote host can't provide the modtime." | |||
| 2509 | (defun tramp-handle-file-writable-p (filename) | 2509 | (defun tramp-handle-file-writable-p (filename) |
| 2510 | "Like `file-writable-p' for tramp files." | 2510 | "Like `file-writable-p' for tramp files." |
| 2511 | (with-parsed-tramp-file-name filename nil | 2511 | (with-parsed-tramp-file-name filename nil |
| 2512 | (if (tramp-handle-file-exists-p filename) | 2512 | (if (file-exists-p filename) |
| 2513 | ;; Existing files must be writable. | 2513 | ;; Existing files must be writable. |
| 2514 | (zerop (tramp-run-test "-w" filename)) | 2514 | (zerop (tramp-run-test "-w" filename)) |
| 2515 | ;; If file doesn't exist, check if directory is writable. | 2515 | ;; If file doesn't exist, check if directory is writable. |
| 2516 | (and (zerop (tramp-run-test | 2516 | (and (zerop (tramp-run-test |
| 2517 | "-d" (tramp-handle-file-name-directory filename))) | 2517 | "-d" (file-name-directory filename))) |
| 2518 | (zerop (tramp-run-test | 2518 | (zerop (tramp-run-test |
| 2519 | "-w" (tramp-handle-file-name-directory filename))))))) | 2519 | "-w" (file-name-directory filename))))))) |
| 2520 | 2520 | ||
| 2521 | (defun tramp-handle-file-ownership-preserved-p (filename) | 2521 | (defun tramp-handle-file-ownership-preserved-p (filename) |
| 2522 | "Like `file-ownership-preserved-p' for tramp files." | 2522 | "Like `file-ownership-preserved-p' for tramp files." |
| 2523 | (with-parsed-tramp-file-name filename nil | 2523 | (with-parsed-tramp-file-name filename nil |
| 2524 | (or (not (tramp-handle-file-exists-p filename)) | 2524 | (or (not (file-exists-p filename)) |
| 2525 | ;; Existing files must be writable. | 2525 | ;; Existing files must be writable. |
| 2526 | (zerop (tramp-run-test "-O" filename))))) | 2526 | (zerop (tramp-run-test "-O" filename))))) |
| 2527 | 2527 | ||
| @@ -3064,7 +3064,7 @@ This is like `dired-recursive-delete-directory' for tramp files." | |||
| 3064 | (with-parsed-tramp-file-name filename nil | 3064 | (with-parsed-tramp-file-name filename nil |
| 3065 | ;; run a shell command 'rm -r <localname>' | 3065 | ;; run a shell command 'rm -r <localname>' |
| 3066 | ;; Code shamelessly stolen for the dired implementation and, um, hacked :) | 3066 | ;; Code shamelessly stolen for the dired implementation and, um, hacked :) |
| 3067 | (or (tramp-handle-file-exists-p filename) | 3067 | (or (file-exists-p filename) |
| 3068 | (signal | 3068 | (signal |
| 3069 | 'file-error | 3069 | 'file-error |
| 3070 | (list "Removing old file name" "no such directory" filename))) | 3070 | (list "Removing old file name" "no such directory" filename))) |
| @@ -3075,7 +3075,7 @@ This is like `dired-recursive-delete-directory' for tramp files." | |||
| 3075 | ;; This might take a while, allow it plenty of time. | 3075 | ;; This might take a while, allow it plenty of time. |
| 3076 | (tramp-wait-for-output 120) | 3076 | (tramp-wait-for-output 120) |
| 3077 | ;; Make sure that it worked... | 3077 | ;; Make sure that it worked... |
| 3078 | (and (tramp-handle-file-exists-p filename) | 3078 | (and (file-exists-p filename) |
| 3079 | (error "Failed to recusively delete %s" filename)))) | 3079 | (error "Failed to recusively delete %s" filename)))) |
| 3080 | 3080 | ||
| 3081 | (defun tramp-handle-dired-call-process (program discard &rest arguments) | 3081 | (defun tramp-handle-dired-call-process (program discard &rest arguments) |
| @@ -3607,45 +3607,47 @@ This will break if COMMAND prints a newline, followed by the value of | |||
| 3607 | 3607 | ||
| 3608 | (defun tramp-handle-find-backup-file-name (filename) | 3608 | (defun tramp-handle-find-backup-file-name (filename) |
| 3609 | "Like `find-backup-file-name' for tramp files." | 3609 | "Like `find-backup-file-name' for tramp files." |
| 3610 | (with-parsed-tramp-file-name filename nil | ||
| 3611 | ;; We set both variables. It doesn't matter whether it is | ||
| 3612 | ;; Emacs or XEmacs | ||
| 3613 | (let ((backup-directory-alist | ||
| 3614 | ;; Emacs case | ||
| 3615 | (when (boundp 'backup-directory-alist) | ||
| 3616 | (if (boundp 'tramp-backup-directory-alist) | ||
| 3617 | (mapcar | ||
| 3618 | '(lambda (x) | ||
| 3619 | (cons | ||
| 3620 | (car x) | ||
| 3621 | (if (and (stringp (cdr x)) | ||
| 3622 | (file-name-absolute-p (cdr x)) | ||
| 3623 | (not (tramp-file-name-p (cdr x)))) | ||
| 3624 | (tramp-make-tramp-file-name | ||
| 3625 | multi-method method user host (cdr x)) | ||
| 3626 | (cdr x)))) | ||
| 3627 | (symbol-value 'tramp-backup-directory-alist)) | ||
| 3628 | (symbol-value 'backup-directory-alist)))) | ||
| 3629 | |||
| 3630 | (bkup-backup-directory-info | ||
| 3631 | ;; XEmacs case | ||
| 3632 | (when (boundp 'bkup-backup-directory-info) | ||
| 3633 | (if (boundp 'tramp-bkup-backup-directory-info) | ||
| 3634 | (mapcar | ||
| 3635 | '(lambda (x) | ||
| 3636 | (nconc | ||
| 3637 | (list (car x)) | ||
| 3638 | (list | ||
| 3639 | (if (and (stringp (car (cdr x))) | ||
| 3640 | (file-name-absolute-p (car (cdr x))) | ||
| 3641 | (not (tramp-file-name-p (car (cdr x))))) | ||
| 3642 | (tramp-make-tramp-file-name | ||
| 3643 | multi-method method user host (car (cdr x))) | ||
| 3644 | (car (cdr x)))) | ||
| 3645 | (cdr (cdr x)))) | ||
| 3646 | (symbol-value 'tramp-bkup-backup-directory-info)) | ||
| 3647 | (symbol-value 'bkup-backup-directory-info))))) | ||
| 3648 | |||
| 3649 | (tramp-run-real-handler 'find-backup-file-name (list filename))))) | ||
| 3610 | 3650 | ||
| 3611 | (if (or (and (not (featurep 'xemacs)) | ||
| 3612 | (not (boundp 'tramp-backup-directory-alist))) | ||
| 3613 | (and (featurep 'xemacs) | ||
| 3614 | (not (boundp 'tramp-bkup-backup-directory-info)))) | ||
| 3615 | |||
| 3616 | ;; No tramp backup directory alist defined, or nil | ||
| 3617 | (tramp-run-real-handler 'find-backup-file-name (list filename)) | ||
| 3618 | |||
| 3619 | (with-parsed-tramp-file-name filename nil | ||
| 3620 | (let* ((backup-var | ||
| 3621 | (copy-tree | ||
| 3622 | (if (featurep 'xemacs) | ||
| 3623 | ;; XEmacs case | ||
| 3624 | (symbol-value 'tramp-bkup-backup-directory-info) | ||
| 3625 | ;; Emacs case | ||
| 3626 | (symbol-value 'tramp-backup-directory-alist)))) | ||
| 3627 | |||
| 3628 | ;; We set both variables. It doesn't matter whether it is | ||
| 3629 | ;; Emacs or XEmacs | ||
| 3630 | (backup-directory-alist backup-var) | ||
| 3631 | (bkup-backup-directory-info backup-var)) | ||
| 3632 | |||
| 3633 | (mapcar | ||
| 3634 | '(lambda (x) | ||
| 3635 | (let ((dir (if (consp (cdr x)) (car (cdr x)) (cdr x)))) | ||
| 3636 | (when (and (stringp dir) | ||
| 3637 | (file-name-absolute-p dir) | ||
| 3638 | (not (tramp-file-name-p dir))) | ||
| 3639 | ;; Prepend absolute directory names with tramp prefix | ||
| 3640 | (if (consp (cdr x)) | ||
| 3641 | (setcar (cdr x) | ||
| 3642 | (tramp-make-tramp-file-name | ||
| 3643 | multi-method method user host dir)) | ||
| 3644 | (setcdr x (tramp-make-tramp-file-name | ||
| 3645 | multi-method method user host dir)))))) | ||
| 3646 | backup-var) | ||
| 3647 | |||
| 3648 | (tramp-run-real-handler 'find-backup-file-name (list filename)))))) | ||
| 3649 | 3651 | ||
| 3650 | ;; CCC grok APPEND, LOCKNAME, CONFIRM | 3652 | ;; CCC grok APPEND, LOCKNAME, CONFIRM |
| 3651 | (defun tramp-handle-write-region | 3653 | (defun tramp-handle-write-region |
| @@ -3689,6 +3691,9 @@ This will break if COMMAND prints a newline, followed by the value of | |||
| 3689 | ;; use an encoding function, but currently we use it always | 3691 | ;; use an encoding function, but currently we use it always |
| 3690 | ;; because this makes the logic simpler. | 3692 | ;; because this makes the logic simpler. |
| 3691 | (setq tmpfil (tramp-make-temp-file)) | 3693 | (setq tmpfil (tramp-make-temp-file)) |
| 3694 | ;; Set current buffer. If connection wasn't open, `file-modes' has | ||
| 3695 | ;; changed it accidently. | ||
| 3696 | (set-buffer curbuf) | ||
| 3692 | ;; We say `no-message' here because we don't want the visited file | 3697 | ;; We say `no-message' here because we don't want the visited file |
| 3693 | ;; modtime data to be clobbered from the temp file. We call | 3698 | ;; modtime data to be clobbered from the temp file. We call |
| 3694 | ;; `set-visited-file-modtime' ourselves later on. | 3699 | ;; `set-visited-file-modtime' ourselves later on. |
| @@ -3972,14 +3977,50 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 3972 | (foreign (apply foreign operation args)) | 3977 | (foreign (apply foreign operation args)) |
| 3973 | (t (tramp-run-real-handler operation args)))))) | 3978 | (t (tramp-run-real-handler operation args)))))) |
| 3974 | 3979 | ||
| 3980 | |||
| 3981 | ;; In Emacs, there is some concurrency due to timers. If a timer | ||
| 3982 | ;; interrupts Tramp and wishes to use the same connection buffer as | ||
| 3983 | ;; the "main" Emacs, then garbage might occur in the connection | ||
| 3984 | ;; buffer. Therefore, we need to make sure that a timer does not use | ||
| 3985 | ;; the same connection buffer as the "main" Emacs. We implement a | ||
| 3986 | ;; cheap global lock, instead of locking each connection buffer | ||
| 3987 | ;; separately. The global lock is based on two variables, | ||
| 3988 | ;; `tramp-locked' and `tramp-locker'. `tramp-locked' is set to true | ||
| 3989 | ;; (with setq) to indicate a lock. But Tramp also calls itself during | ||
| 3990 | ;; processing of a single file operation, so we need to allow | ||
| 3991 | ;; recursive calls. That's where the `tramp-locker' variable comes in | ||
| 3992 | ;; -- it is let-bound to t during the execution of the current | ||
| 3993 | ;; handler. So if `tramp-locked' is t and `tramp-locker' is also t, | ||
| 3994 | ;; then we should just proceed because we have been called | ||
| 3995 | ;; recursively. But if `tramp-locker' is nil, then we are a timer | ||
| 3996 | ;; interrupting the "main" Emacs, and then we signal an error. | ||
| 3997 | |||
| 3998 | (defvar tramp-locked nil | ||
| 3999 | "If non-nil, then Tramp is currently busy. | ||
| 4000 | Together with `tramp-locker', this implements a locking mechanism | ||
| 4001 | preventing reentrant calls of Tramp.") | ||
| 4002 | |||
| 4003 | (defvar tramp-locker nil | ||
| 4004 | "If non-nil, then a caller has locked Tramp. | ||
| 4005 | Together with `tramp-locked', this implements a locking mechanism | ||
| 4006 | preventing reentrant calls of Tramp.") | ||
| 4007 | |||
| 3975 | (defun tramp-sh-file-name-handler (operation &rest args) | 4008 | (defun tramp-sh-file-name-handler (operation &rest args) |
| 3976 | "Invoke remote-shell Tramp file name handler. | 4009 | "Invoke remote-shell Tramp file name handler. |
| 3977 | Fall back to normal file name handler if no Tramp handler exists." | 4010 | Fall back to normal file name handler if no Tramp handler exists." |
| 3978 | (save-match-data | 4011 | (when (and tramp-locked (not tramp-locker)) |
| 3979 | (let ((fn (assoc operation tramp-file-name-handler-alist))) | 4012 | (signal 'file-error "Forbidden reentrant call of Tramp")) |
| 3980 | (if fn | 4013 | (let ((tl tramp-locked)) |
| 3981 | (apply (cdr fn) args) | 4014 | (unwind-protect |
| 3982 | (tramp-run-real-handler operation args))))) | 4015 | (progn |
| 4016 | (setq tramp-locked t) | ||
| 4017 | (let ((tramp-locker t)) | ||
| 4018 | (save-match-data | ||
| 4019 | (let ((fn (assoc operation tramp-file-name-handler-alist))) | ||
| 4020 | (if fn | ||
| 4021 | (apply (cdr fn) args) | ||
| 4022 | (tramp-run-real-handler operation args)))))) | ||
| 4023 | (setq tramp-locked tl)))) | ||
| 3983 | 4024 | ||
| 3984 | ;;;###autoload | 4025 | ;;;###autoload |
| 3985 | (defun tramp-completion-file-name-handler (operation &rest args) | 4026 | (defun tramp-completion-file-name-handler (operation &rest args) |
| @@ -4062,7 +4103,7 @@ necessary anymore." | |||
| 4062 | (tramp-make-tramp-file-name multi-method method | 4103 | (tramp-make-tramp-file-name multi-method method |
| 4063 | user host x))) | 4104 | user host x))) |
| 4064 | (read (current-buffer)))))) | 4105 | (read (current-buffer)))))) |
| 4065 | (list (tramp-handle-expand-file-name name)))))) | 4106 | (list (expand-file-name name)))))) |
| 4066 | 4107 | ||
| 4067 | ;; Check for complete.el and override PC-expand-many-files if appropriate. | 4108 | ;; Check for complete.el and override PC-expand-many-files if appropriate. |
| 4068 | (eval-and-compile | 4109 | (eval-and-compile |
| @@ -4073,7 +4114,7 @@ necessary anymore." | |||
| 4073 | (symbol-function 'PC-expand-many-files)) | 4114 | (symbol-function 'PC-expand-many-files)) |
| 4074 | (defun PC-expand-many-files (name) | 4115 | (defun PC-expand-many-files (name) |
| 4075 | (if (tramp-tramp-file-p name) | 4116 | (if (tramp-tramp-file-p name) |
| 4076 | (tramp-handle-expand-many-files name) | 4117 | (expand-many-files name) |
| 4077 | (tramp-save-PC-expand-many-files name)))) | 4118 | (tramp-save-PC-expand-many-files name)))) |
| 4078 | 4119 | ||
| 4079 | ;; Why isn't eval-after-load sufficient? | 4120 | ;; Why isn't eval-after-load sufficient? |
| @@ -4824,17 +4865,17 @@ file exists and nonzero exit status otherwise." | |||
| 4824 | ;; `/usr/bin/test -e' In case `/bin/test' does not exist. | 4865 | ;; `/usr/bin/test -e' In case `/bin/test' does not exist. |
| 4825 | (unless (or | 4866 | (unless (or |
| 4826 | (and (setq tramp-file-exists-command "test -e %s") | 4867 | (and (setq tramp-file-exists-command "test -e %s") |
| 4827 | (tramp-handle-file-exists-p existing) | 4868 | (file-exists-p existing) |
| 4828 | (not (tramp-handle-file-exists-p nonexisting))) | 4869 | (not (file-exists-p nonexisting))) |
| 4829 | (and (setq tramp-file-exists-command "/bin/test -e %s") | 4870 | (and (setq tramp-file-exists-command "/bin/test -e %s") |
| 4830 | (tramp-handle-file-exists-p existing) | 4871 | (file-exists-p existing) |
| 4831 | (not (tramp-handle-file-exists-p nonexisting))) | 4872 | (not (file-exists-p nonexisting))) |
| 4832 | (and (setq tramp-file-exists-command "/usr/bin/test -e %s") | 4873 | (and (setq tramp-file-exists-command "/usr/bin/test -e %s") |
| 4833 | (tramp-handle-file-exists-p existing) | 4874 | (file-exists-p existing) |
| 4834 | (not (tramp-handle-file-exists-p nonexisting))) | 4875 | (not (file-exists-p nonexisting))) |
| 4835 | (and (setq tramp-file-exists-command "ls -d %s") | 4876 | (and (setq tramp-file-exists-command "ls -d %s") |
| 4836 | (tramp-handle-file-exists-p existing) | 4877 | (file-exists-p existing) |
| 4837 | (not (tramp-handle-file-exists-p nonexisting)))) | 4878 | (not (file-exists-p nonexisting)))) |
| 4838 | (error "Couldn't find command to check if file exists.")))) | 4879 | (error "Couldn't find command to check if file exists.")))) |
| 4839 | 4880 | ||
| 4840 | 4881 | ||
| @@ -4896,9 +4937,8 @@ file exists and nonzero exit status otherwise." | |||
| 4896 | METHOD, USER and HOST specify the connection, CMD (the absolute file name of) | 4937 | METHOD, USER and HOST specify the connection, CMD (the absolute file name of) |
| 4897 | the `ls' executable. Returns t if CMD supports the `-n' option, nil | 4938 | the `ls' executable. Returns t if CMD supports the `-n' option, nil |
| 4898 | otherwise." | 4939 | otherwise." |
| 4899 | (tramp-message 9 "Checking remote `%s' command for `-n' option" | 4940 | (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd) |
| 4900 | cmd) | 4941 | (when (file-executable-p |
| 4901 | (when (tramp-handle-file-executable-p | ||
| 4902 | (tramp-make-tramp-file-name multi-method method user host cmd)) | 4942 | (tramp-make-tramp-file-name multi-method method user host cmd)) |
| 4903 | (let ((result nil)) | 4943 | (let ((result nil)) |
| 4904 | (tramp-message 7 "Testing remote command `%s' for -n..." cmd) | 4944 | (tramp-message 7 "Testing remote command `%s' for -n..." cmd) |
| @@ -4956,7 +4996,7 @@ Returns nil if none was found, else the command is returned." | |||
| 4956 | "Query the user for a password." | 4996 | "Query the user for a password." |
| 4957 | (let ((pw-prompt (match-string 0))) | 4997 | (let ((pw-prompt (match-string 0))) |
| 4958 | (tramp-message 9 "Sending password") | 4998 | (tramp-message 9 "Sending password") |
| 4959 | (tramp-enter-password p pw-prompt))) | 4999 | (tramp-enter-password p pw-prompt user host))) |
| 4960 | 5000 | ||
| 4961 | (defun tramp-action-succeed (p multi-method method user host) | 5001 | (defun tramp-action-succeed (p multi-method method user host) |
| 4962 | "Signal success in finding shell prompt." | 5002 | "Signal success in finding shell prompt." |
| @@ -5034,7 +5074,7 @@ The terminal type can be configured with `tramp-terminal-type'." | |||
| 5034 | (defun tramp-multi-action-password (p method user host) | 5074 | (defun tramp-multi-action-password (p method user host) |
| 5035 | "Query the user for a password." | 5075 | "Query the user for a password." |
| 5036 | (tramp-message 9 "Sending password") | 5076 | (tramp-message 9 "Sending password") |
| 5037 | (tramp-enter-password p (match-string 0))) | 5077 | (tramp-enter-password p (match-string 0) user host)) |
| 5038 | 5078 | ||
| 5039 | (defun tramp-multi-action-succeed (p method user host) | 5079 | (defun tramp-multi-action-succeed (p method user host) |
| 5040 | "Signal success in finding shell prompt." | 5080 | "Signal success in finding shell prompt." |
| @@ -5049,6 +5089,11 @@ The terminal type can be configured with `tramp-terminal-type'." | |||
| 5049 | (erase-buffer) | 5089 | (erase-buffer) |
| 5050 | (throw 'tramp-action 'permission-denied)) | 5090 | (throw 'tramp-action 'permission-denied)) |
| 5051 | 5091 | ||
| 5092 | (defun tramp-multi-action-process-alive (p method user host) | ||
| 5093 | "Check whether a process has finished." | ||
| 5094 | (unless (memq (process-status p) '(run open)) | ||
| 5095 | (throw 'tramp-action 'process-died))) | ||
| 5096 | |||
| 5052 | ;; Functions for processing the actions. | 5097 | ;; Functions for processing the actions. |
| 5053 | 5098 | ||
| 5054 | (defun tramp-process-one-action (p multi-method method user host actions) | 5099 | (defun tramp-process-one-action (p multi-method method user host actions) |
| @@ -5246,12 +5291,13 @@ arguments, and xx will be used as the host name to connect to. | |||
| 5246 | (login-args (tramp-get-method-parameter | 5291 | (login-args (tramp-get-method-parameter |
| 5247 | multi-method | 5292 | multi-method |
| 5248 | (tramp-find-method multi-method method user host) | 5293 | (tramp-find-method multi-method method user host) |
| 5249 | user host 'tramp-login-args))) | 5294 | user host 'tramp-login-args)) |
| 5295 | (real-host host)) | ||
| 5250 | ;; The following should be changed. We need a more general | 5296 | ;; The following should be changed. We need a more general |
| 5251 | ;; mechanism to parse extra host args. | 5297 | ;; mechanism to parse extra host args. |
| 5252 | (when (string-match "\\([^#]*\\)#\\(.*\\)" host) | 5298 | (when (string-match "\\([^#]*\\)#\\(.*\\)" host) |
| 5253 | (setq login-args (cons "-p" (cons (match-string 2 host) login-args))) | 5299 | (setq login-args (cons "-p" (cons (match-string 2 host) login-args))) |
| 5254 | (setq host (match-string 1 host))) | 5300 | (setq real-host (match-string 1 host))) |
| 5255 | (setenv "TERM" tramp-terminal-type) | 5301 | (setenv "TERM" tramp-terminal-type) |
| 5256 | (let* ((default-directory (tramp-temporary-file-directory)) | 5302 | (let* ((default-directory (tramp-temporary-file-directory)) |
| 5257 | ;; If we omit the conditional, we would use | 5303 | ;; If we omit the conditional, we would use |
| @@ -5262,9 +5308,9 @@ arguments, and xx will be used as the host name to connect to. | |||
| 5262 | tramp-dos-coding-system)) | 5308 | tramp-dos-coding-system)) |
| 5263 | (p (if (and user (not (string= user ""))) | 5309 | (p (if (and user (not (string= user ""))) |
| 5264 | (apply #'start-process bufnam buf login-program | 5310 | (apply #'start-process bufnam buf login-program |
| 5265 | host "-l" user login-args) | 5311 | real-host "-l" user login-args) |
| 5266 | (apply #'start-process bufnam buf login-program | 5312 | (apply #'start-process bufnam buf login-program |
| 5267 | host login-args))) | 5313 | real-host login-args))) |
| 5268 | (found nil)) | 5314 | (found nil)) |
| 5269 | (tramp-set-process-query-on-exit-flag p nil) | 5315 | (tramp-set-process-query-on-exit-flag p nil) |
| 5270 | 5316 | ||
| @@ -5547,10 +5593,10 @@ seconds. If not, it produces an error message with the given ERROR-ARGS." | |||
| 5547 | (pop-to-buffer (buffer-name)) | 5593 | (pop-to-buffer (buffer-name)) |
| 5548 | (apply 'error error-args))) | 5594 | (apply 'error error-args))) |
| 5549 | 5595 | ||
| 5550 | (defun tramp-enter-password (p prompt) | 5596 | (defun tramp-enter-password (p prompt user host) |
| 5551 | "Prompt for a password and send it to the remote end. | 5597 | "Prompt for a password and send it to the remote end. |
| 5552 | Uses PROMPT as a prompt and sends the password to process P." | 5598 | Uses PROMPT as a prompt and sends the password to process P." |
| 5553 | (let ((pw (tramp-read-passwd prompt))) | 5599 | (let ((pw (tramp-read-passwd user host prompt))) |
| 5554 | (erase-buffer) | 5600 | (erase-buffer) |
| 5555 | (process-send-string | 5601 | (process-send-string |
| 5556 | p (concat pw | 5602 | p (concat pw |
| @@ -6717,16 +6763,11 @@ this is the function `temp-directory'." | |||
| 6717 | "`temp-directory' is defined -- using /tmp.")) | 6763 | "`temp-directory' is defined -- using /tmp.")) |
| 6718 | (file-name-as-directory "/tmp")))) | 6764 | (file-name-as-directory "/tmp")))) |
| 6719 | 6765 | ||
| 6720 | (defun tramp-read-passwd (prompt) | 6766 | (defun tramp-read-passwd (user host prompt) |
| 6721 | "Read a password from user (compat function). | 6767 | "Read a password from user (compat function). |
| 6722 | Invokes `password-read' if available, `read-passwd' else." | 6768 | Invokes `password-read' if available, `read-passwd' else." |
| 6723 | (if (functionp 'password-read) | 6769 | (if (functionp 'password-read) |
| 6724 | (let* ((user (or tramp-current-user (user-login-name))) | 6770 | (let* ((key (concat (or user (user-login-name)) "@" host)) |
| 6725 | (host (or tramp-current-host (system-name))) | ||
| 6726 | (key (if (and (stringp user) (stringp host)) | ||
| 6727 | (concat user "@" host) | ||
| 6728 | (concat "[" (mapconcat 'identity user "/") "]@[" | ||
| 6729 | (mapconcat 'identity host "/") "]"))) | ||
| 6730 | (password (apply #'password-read (list prompt key)))) | 6771 | (password (apply #'password-read (list prompt key)))) |
| 6731 | (apply #'password-cache-add (list key password)) | 6772 | (apply #'password-cache-add (list key password)) |
| 6732 | password) | 6773 | password) |
diff --git a/man/trampver.texi b/man/trampver.texi index a62583fd6d4..32ab2349241 100644 --- a/man/trampver.texi +++ b/man/trampver.texi | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | @c In the Tramp CVS, the version number is auto-frobbed from | 4 | @c In the Tramp CVS, the version number is auto-frobbed from |
| 5 | @c configure.ac, so you should edit that file and run | 5 | @c configure.ac, so you should edit that file and run |
| 6 | @c "autoconf && ./configure" to change the version number. | 6 | @c "autoconf && ./configure" to change the version number. |
| 7 | @set trampver 2.0.42 | 7 | @set trampver 2.0.43 |
| 8 | 8 | ||
| 9 | @c Other flags from configuration | 9 | @c Other flags from configuration |
| 10 | @set prefix /usr/local | 10 | @set prefix /usr/local |