diff options
| author | Kai Großjohann | 2003-11-30 18:15:22 +0000 |
|---|---|---|
| committer | Kai Großjohann | 2003-11-30 18:15:22 +0000 |
| commit | c951aecb3091175d0e36ac8f62f8b5dfd073c382 (patch) | |
| tree | b84dbb6f4b5d81acd316b15a44a6f0c25ad55793 | |
| parent | d344ecbbaeecbcd6f13e49424436c01fe190702e (diff) | |
| download | emacs-c951aecb3091175d0e36ac8f62f8b5dfd073c382.tar.gz emacs-c951aecb3091175d0e36ac8f62f8b5dfd073c382.zip | |
(tramp-chunksize): Extend docstring. Suggested by
Charles Curley <charlescurley@charlescurley.com>.
(tramp-multi-connection-function-alist): Add ssht entry which adds
"-e none -t -t" to the list of ssh args. Suggested by Adrian
Aichner.
(tramp-get-method-parameter): New function to retrieve a method
parameter. This allows for omission of method parameters.
Callers adjusted.
| -rw-r--r-- | lisp/ChangeLog | 44 | ||||
| -rw-r--r-- | lisp/net/tramp-ftp.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 24 | ||||
| -rw-r--r-- | lisp/net/tramp-vc.el | 11 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 188 | ||||
| -rw-r--r-- | lisp/net/trampver.el | 2 |
6 files changed, 150 insertions, 121 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b9b459145b8..2f500bff142 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,47 @@ | |||
| 1 | 2003-11-30 Kai Grossjohann <kai.grossjohann@gmx.net> | ||
| 2 | Version 2.0.38 of Tramp released. | ||
| 3 | |||
| 4 | * net/tramp.el (tramp-chunksize): Extend docstring. Suggested by | ||
| 5 | Charles Curley <charlescurley@charlescurley.com>. | ||
| 6 | (tramp-multi-connection-function-alist): Add ssht entry which adds | ||
| 7 | "-e none -t -t" to the list of ssh args. Suggested by Adrian | ||
| 8 | Aichner. | ||
| 9 | (tramp-get-method-parameter): New function to retrieve a method | ||
| 10 | parameter. This allows for omission of method parameters. | ||
| 11 | Callers adjusted. | ||
| 12 | |||
| 13 | 2003-11-25 Michael Albinus <Michael.Albinus@alcatel.de> | ||
| 14 | |||
| 15 | * net/tramp.el: Add new optional parameter ID-FORMAT to | ||
| 16 | `file-attributes'. Calls of `file-attributes' won't use this | ||
| 17 | parameter for backward compatibility reasons. | ||
| 18 | (tramp-perl-file-attributes): Add a new parameter to Perl script | ||
| 19 | in order to handle uid/gid as strings, if desired. | ||
| 20 | (tramp-handle-file-truename, tramp-handle-file-symlink-p): Apply | ||
| 21 | `file-attributes' instead of `tramp-handle-file-attributes' in | ||
| 22 | order to make the function more general. | ||
| 23 | (tramp-handle-file-attributes): Replace proprietary optional | ||
| 24 | parameter NONNUMERIC by the recently (Emacs 21.4) introduced | ||
| 25 | ID-FORMAT. | ||
| 26 | (tramp-handle-file-attributes-with-perl): Handle parameter | ||
| 27 | NONNUMERIC if set. This wasn't done in the past. | ||
| 28 | (tramp-post-connection): Apply second parameter "$2" if | ||
| 29 | `tramp-remote-perl' is called. | ||
| 30 | |||
| 31 | * net/tramp-smb.el (tramp-smb-handle-delete-file): Correct | ||
| 32 | cut'n'waste error (`filename' instead of `directory'). | ||
| 33 | (tramp-smb-handle-directory-files-and-attributes) | ||
| 34 | (tramp-smb-handle-file-attributes): Add recently (Emacs 21.4) | ||
| 35 | introduced parameter ID-FORMAT. | ||
| 36 | (tramp-smb-handle-make-directory-internal): Correct cut'n'waste | ||
| 37 | error (`directory' instead of `ldir'). | ||
| 38 | |||
| 39 | * net/tramp-vc.el (tramp-handle-vc-user-login-name): Check if | ||
| 40 | `file-attributes' has a second parameter. If yes, apply it with | ||
| 41 | value "'integer". Otherwise, don't use that parameter (default is | ||
| 42 | integer format). | ||
| 43 | |||
| 44 | |||
| 1 | 2003-11-30 Luc Teirlinck <teirllm@auburn.edu> | 45 | 2003-11-30 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 46 | ||
| 3 | * help.el (help-map): Bind `display-local-help' to `C-h .'. | 47 | * help.el (help-map): Bind `display-local-help' to `C-h .'. |
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 7c9484f0c44..c81e49bf77c 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el | |||
| @@ -137,6 +137,8 @@ pass to the OPERATION." | |||
| 137 | ;; pretended in `tramp-file-name-handler' otherwise. | 137 | ;; pretended in `tramp-file-name-handler' otherwise. |
| 138 | ;; Furthermore, there are no backup files on FTP hosts. | 138 | ;; Furthermore, there are no backup files on FTP hosts. |
| 139 | ;; Worth further investigations. | 139 | ;; Worth further investigations. |
| 140 | ;; * Map /multi:ssh:out@gate:ftp:kai@real.host:/path/to.file | ||
| 141 | ;; on Ange-FTP gateways. | ||
| 140 | 142 | ||
| 141 | ;;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff | 143 | ;;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff |
| 142 | ;;; tramp-ftp.el ends here | 144 | ;;; tramp-ftp.el ends here |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index fd902cd61b8..95f3fb330c4 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -290,7 +290,7 @@ KEEP-DATE is not handled in case NEWNAME resides on an SMB server." | |||
| 290 | (tramp-smb-send-command user host (format "cd \\")) | 290 | (tramp-smb-send-command user host (format "cd \\")) |
| 291 | ;; Error | 291 | ;; Error |
| 292 | (tramp-smb-send-command user host (format "cd \\")) | 292 | (tramp-smb-send-command user host (format "cd \\")) |
| 293 | (error "Cannot delete file `%s'" directory)))))) | 293 | (error "Cannot delete file `%s'" filename)))))) |
| 294 | 294 | ||
| 295 | (defun tramp-smb-handle-directory-files | 295 | (defun tramp-smb-handle-directory-files |
| 296 | (directory &optional full match nosort) | 296 | (directory &optional full match nosort) |
| @@ -324,18 +324,18 @@ KEEP-DATE is not handled in case NEWNAME resides on an SMB server." | |||
| 324 | entries)))) | 324 | entries)))) |
| 325 | 325 | ||
| 326 | (defun tramp-smb-handle-directory-files-and-attributes | 326 | (defun tramp-smb-handle-directory-files-and-attributes |
| 327 | (directory &optional full match nosort) | 327 | (directory &optional full match nosort id-format) |
| 328 | "Like `directory-files-and-attributes' for tramp files." | 328 | "Like `directory-files-and-attributes' for tramp files." |
| 329 | (mapcar | 329 | (mapcar |
| 330 | (lambda (x) | 330 | (lambda (x) |
| 331 | (cons x (file-attributes | 331 | ;; We cannot call `file-attributes' for backward compatibility reasons. |
| 332 | (if full x (concat (file-name-as-directory directory) x))))) | 332 | ;; Its optional parameter ID-FORMAT is introduced with Emacs 21.4. |
| 333 | (cons x (tramp-smb-handle-file-attributes | ||
| 334 | (if full x (concat (file-name-as-directory directory) x)) id-format))) | ||
| 333 | (directory-files directory full match nosort))) | 335 | (directory-files directory full match nosort))) |
| 334 | 336 | ||
| 335 | (defun tramp-smb-handle-file-attributes (filename &optional nonnumeric) | 337 | (defun tramp-smb-handle-file-attributes (filename &optional id-format) |
| 336 | "Like `file-attributes' for tramp files. | 338 | "Like `file-attributes' for tramp files." |
| 337 | Optional argument NONNUMERIC means return user and group name | ||
| 338 | rather than as numbers." | ||
| 339 | ; (with-parsed-tramp-file-name filename nil | 339 | ; (with-parsed-tramp-file-name filename nil |
| 340 | (let (user host localname) | 340 | (let (user host localname) |
| 341 | (with-parsed-tramp-file-name filename l | 341 | (with-parsed-tramp-file-name filename l |
| @@ -346,6 +346,8 @@ rather than as numbers." | |||
| 346 | (entries (tramp-smb-get-file-entries user host share file)) | 346 | (entries (tramp-smb-get-file-entries user host share file)) |
| 347 | (entry (and entries | 347 | (entry (and entries |
| 348 | (assoc (file-name-nondirectory file) entries))) | 348 | (assoc (file-name-nondirectory file) entries))) |
| 349 | (uid (if (and id-format (equal id-format 'string)) "nobody" -1)) | ||
| 350 | (gid (if (and id-format (equal id-format 'string)) "nogroup" -1)) | ||
| 349 | (inode (tramp-smb-get-inode share file)) | 351 | (inode (tramp-smb-get-inode share file)) |
| 350 | (device (tramp-get-device nil tramp-smb-method user host))) | 352 | (device (tramp-get-device nil tramp-smb-method user host))) |
| 351 | 353 | ||
| @@ -354,8 +356,8 @@ rather than as numbers." | |||
| 354 | (list (and (string-match "d" (nth 1 entry)) | 356 | (list (and (string-match "d" (nth 1 entry)) |
| 355 | t) ;0 file type | 357 | t) ;0 file type |
| 356 | -1 ;1 link count | 358 | -1 ;1 link count |
| 357 | -1 ;2 uid | 359 | uid ;2 uid |
| 358 | -1 ;3 gid | 360 | gid ;3 gid |
| 359 | '(0 0) ;4 atime | 361 | '(0 0) ;4 atime |
| 360 | (nth 3 entry) ;5 mtime | 362 | (nth 3 entry) ;5 mtime |
| 361 | '(0 0) ;6 ctime | 363 | '(0 0) ;6 ctime |
| @@ -546,7 +548,7 @@ WILDCARD and FULL-DIRECTORY-P are not handled." | |||
| 546 | "Like `make-directory-internal' for tramp files." | 548 | "Like `make-directory-internal' for tramp files." |
| 547 | (setq directory (directory-file-name (expand-file-name directory))) | 549 | (setq directory (directory-file-name (expand-file-name directory))) |
| 548 | (unless (file-name-absolute-p directory) | 550 | (unless (file-name-absolute-p directory) |
| 549 | (setq ldir (concat default-directory directory))) | 551 | (setq directory (concat default-directory directory))) |
| 550 | ; (with-parsed-tramp-file-name directory nil | 552 | ; (with-parsed-tramp-file-name directory nil |
| 551 | (let (user host localname) | 553 | (let (user host localname) |
| 552 | (with-parsed-tramp-file-name directory l | 554 | (with-parsed-tramp-file-name directory l |
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el index af86cdcc98d..ded30f4b09c 100644 --- a/lisp/net/tramp-vc.el +++ b/lisp/net/tramp-vc.el | |||
| @@ -391,8 +391,15 @@ filename we are thinking about..." | |||
| 391 | ;; Pacify byte-compiler; this symbol is bound in the calling | 391 | ;; Pacify byte-compiler; this symbol is bound in the calling |
| 392 | ;; function. CCC: Maybe it would be better to move the | 392 | ;; function. CCC: Maybe it would be better to move the |
| 393 | ;; boundness-checking into this function? | 393 | ;; boundness-checking into this function? |
| 394 | (let ((file (symbol-value 'file))) | 394 | (let ((file (symbol-value 'file)) |
| 395 | (if (and uid (/= uid (nth 2 (file-attributes file)))) | 395 | (remote-uid |
| 396 | ;; With Emacs 21.4, `file-attributes' has got an optional parameter | ||
| 397 | ;; ID-FORMAT. Handle this case backwards compatible. | ||
| 398 | (if (and (functionp 'subr-arity) | ||
| 399 | (= 2 (cdr (subr-arity (symbol-function 'file-attributes))))) | ||
| 400 | (nth 2 (file-attributes file 'integer)) | ||
| 401 | (nth 2 (file-attributes file))))) | ||
| 402 | (if (and uid (/= uid remote-uid)) | ||
| 396 | (error "tramp-handle-vc-user-login-name cannot map a uid to a name") | 403 | (error "tramp-handle-vc-user-login-name cannot map a uid to a name") |
| 397 | (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) | 404 | (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) |
| 398 | (u (tramp-file-name-user v))) | 405 | (u (tramp-file-name-user v))) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3949027436f..949d76364fc 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -569,6 +569,7 @@ variable `tramp-methods'." | |||
| 569 | ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n") | 569 | ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n") |
| 570 | ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") | 570 | ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") |
| 571 | ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") | 571 | ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") |
| 572 | ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") | ||
| 572 | ("su" tramp-multi-connect-su "su - %u%n") | 573 | ("su" tramp-multi-connect-su "su - %u%n") |
| 573 | ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) | 574 | ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) |
| 574 | "*List of connection functions for multi-hop methods. | 575 | "*List of connection functions for multi-hop methods. |
| @@ -1250,6 +1251,17 @@ checked via the following code: | |||
| 1250 | (re-search-forward \"\\\\w+\") | 1251 | (re-search-forward \"\\\\w+\") |
| 1251 | (message \"Bytes sent: %s\\tBytes received: %s\" bytes (match-string 0)))) | 1252 | (message \"Bytes sent: %s\\tBytes received: %s\" bytes (match-string 0)))) |
| 1252 | 1253 | ||
| 1254 | In the Emacs normally running Tramp, evaluate the above code. | ||
| 1255 | You can do this, for example, by pasting it into the `*scratch*' | ||
| 1256 | buffer and then hitting C-j with the cursor after the last | ||
| 1257 | closing parenthesis. | ||
| 1258 | |||
| 1259 | If your Emacs is buggy, the sent and received numbers will be | ||
| 1260 | different. In that case, you'll want to set this variable to | ||
| 1261 | some number. For those people who have needed it, the value 500 | ||
| 1262 | seems to have worked well. There is no way to predict what value | ||
| 1263 | you need; maybe you could just experiment a bit. | ||
| 1264 | |||
| 1253 | Please raise a bug report via \"M-x tramp-bug\" if your system needs | 1265 | Please raise a bug report via \"M-x tramp-bug\" if your system needs |
| 1254 | this variable to be set as well." | 1266 | this variable to be set as well." |
| 1255 | :group 'tramp | 1267 | :group 'tramp |
| @@ -1405,13 +1417,15 @@ some systems don't, and for them we have this shell function.") | |||
| 1405 | ;; The device number is returned as "-1", because there will be a virtual | 1417 | ;; The device number is returned as "-1", because there will be a virtual |
| 1406 | ;; device number set in `tramp-handle-file-attributes' | 1418 | ;; device number set in `tramp-handle-file-attributes' |
| 1407 | (defconst tramp-perl-file-attributes "\ | 1419 | (defconst tramp-perl-file-attributes "\ |
| 1408 | $f = $ARGV[0]; | 1420 | ($f, $n) = @ARGV; |
| 1409 | @s = lstat($f); | 1421 | @s = lstat($f); |
| 1410 | if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; } | 1422 | if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; } |
| 1411 | elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; } | 1423 | elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; } |
| 1412 | else { $l = \"nil\" }; | 1424 | else { $l = \"nil\" }; |
| 1413 | printf(\"(%s %u %d %d (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) -1)\\n\", | 1425 | $u = ($n eq \"nil\") ? $s[4] : getpwuid($s[4]); |
| 1414 | $l, $s[3], $s[4], $s[5], $s[8] >> 16 & 0xffff, $s[8] & 0xffff, | 1426 | $g = ($n eq \"nil\") ? $s[5] : getgrgid($s[5]); |
| 1427 | printf(\"(%s %u %s %s (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) -1)\\n\", | ||
| 1428 | $l, $s[3], $u, $g, $s[8] >> 16 & 0xffff, $s[8] & 0xffff, | ||
| 1415 | $s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff, | 1429 | $s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff, |
| 1416 | $s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff);" | 1430 | $s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff);" |
| 1417 | "Perl script to produce output suitable for use with `file-attributes' | 1431 | "Perl script to produce output suitable for use with `file-attributes' |
| @@ -1900,7 +1914,7 @@ target of the symlink differ." | |||
| 1900 | (append '("") (reverse result) (list thisstep)) | 1914 | (append '("") (reverse result) (list thisstep)) |
| 1901 | "/")) | 1915 | "/")) |
| 1902 | (setq symlink-target | 1916 | (setq symlink-target |
| 1903 | (nth 0 (tramp-handle-file-attributes | 1917 | (nth 0 (file-attributes |
| 1904 | (tramp-make-tramp-file-name | 1918 | (tramp-make-tramp-file-name |
| 1905 | multi-method method user host | 1919 | multi-method method user host |
| 1906 | (mapconcat 'identity | 1920 | (mapconcat 'identity |
| @@ -1979,11 +1993,10 @@ target of the symlink differ." | |||
| 1979 | ;; CCC: This should check for an error condition and signal failure | 1993 | ;; CCC: This should check for an error condition and signal failure |
| 1980 | ;; when something goes wrong. | 1994 | ;; when something goes wrong. |
| 1981 | ;; Daniel Pittman <daniel@danann.net> | 1995 | ;; Daniel Pittman <daniel@danann.net> |
| 1982 | (defun tramp-handle-file-attributes (filename &optional nonnumeric) | 1996 | (defun tramp-handle-file-attributes (filename &optional id-format) |
| 1983 | "Like `file-attributes' for tramp files. | 1997 | "Like `file-attributes' for tramp files." |
| 1984 | Optional argument NONNUMERIC means return user and group name | 1998 | (let ((nonnumeric (and id-format (equal id-format 'string))) |
| 1985 | rather than as numbers." | 1999 | result) |
| 1986 | (let (result) | ||
| 1987 | (with-parsed-tramp-file-name filename nil | 2000 | (with-parsed-tramp-file-name filename nil |
| 1988 | (when (tramp-handle-file-exists-p filename) | 2001 | (when (tramp-handle-file-exists-p filename) |
| 1989 | ;; file exists, find out stuff | 2002 | ;; file exists, find out stuff |
| @@ -2097,8 +2110,8 @@ is initially created and is kept cached by the remote shell." | |||
| 2097 | multi-method method user host localname)) | 2110 | multi-method method user host localname)) |
| 2098 | (tramp-send-command | 2111 | (tramp-send-command |
| 2099 | multi-method method user host | 2112 | multi-method method user host |
| 2100 | (format "tramp_file_attributes %s" | 2113 | (format "tramp_file_attributes %s %s" |
| 2101 | (tramp-shell-quote-argument localname))) | 2114 | (tramp-shell-quote-argument localname) nonnumeric)) |
| 2102 | (tramp-wait-for-output) | 2115 | (tramp-wait-for-output) |
| 2103 | (let ((result (read (current-buffer)))) | 2116 | (let ((result (read (current-buffer)))) |
| 2104 | (setcar (nthcdr 8 result) | 2117 | (setcar (nthcdr 8 result) |
| @@ -2310,7 +2323,7 @@ if the remote host can't provide the modtime." | |||
| 2310 | (defun tramp-handle-file-symlink-p (filename) | 2323 | (defun tramp-handle-file-symlink-p (filename) |
| 2311 | "Like `file-symlink-p' for tramp files." | 2324 | "Like `file-symlink-p' for tramp files." |
| 2312 | (with-parsed-tramp-file-name filename nil | 2325 | (with-parsed-tramp-file-name filename nil |
| 2313 | (let ((x (car (tramp-handle-file-attributes filename)))) | 2326 | (let ((x (car (file-attributes filename)))) |
| 2314 | (when (stringp x) | 2327 | (when (stringp x) |
| 2315 | ;; When Tramp is running on VMS, then `file-name-absolute-p' | 2328 | ;; When Tramp is running on VMS, then `file-name-absolute-p' |
| 2316 | ;; might do weird things. | 2329 | ;; might do weird things. |
| @@ -3030,14 +3043,14 @@ This will break if COMMAND prints a newline, followed by the value of | |||
| 3030 | (with-parsed-tramp-file-name filename nil | 3043 | (with-parsed-tramp-file-name filename nil |
| 3031 | (let ((output-buf (get-buffer-create "*tramp output*")) | 3044 | (let ((output-buf (get-buffer-create "*tramp output*")) |
| 3032 | (tramp-buf (tramp-get-buffer multi-method method user host)) | 3045 | (tramp-buf (tramp-get-buffer multi-method method user host)) |
| 3033 | (copy-program (tramp-get-copy-program | 3046 | (copy-program (tramp-get-method-parameter |
| 3034 | multi-method | 3047 | multi-method |
| 3035 | (tramp-find-method multi-method method user host) | 3048 | (tramp-find-method multi-method method user host) |
| 3036 | user host)) | 3049 | user host 'tramp-copy-program)) |
| 3037 | (copy-args (tramp-get-copy-args | 3050 | (copy-args (tramp-get-method-parameter |
| 3038 | multi-method | 3051 | multi-method |
| 3039 | (tramp-find-method multi-method method user host) | 3052 | (tramp-find-method multi-method method user host) |
| 3040 | user host)) | 3053 | user host 'tramp-copy-args)) |
| 3041 | ;; We used to bind the following as late as possible. | 3054 | ;; We used to bind the following as late as possible. |
| 3042 | ;; loc-enc and loc-dec were bound directly before the if | 3055 | ;; loc-enc and loc-dec were bound directly before the if |
| 3043 | ;; statement that checks them. But the functions | 3056 | ;; statement that checks them. But the functions |
| @@ -3212,14 +3225,14 @@ This will break if COMMAND prints a newline, followed by the value of | |||
| 3212 | (error "File not overwritten"))) | 3225 | (error "File not overwritten"))) |
| 3213 | (with-parsed-tramp-file-name filename nil | 3226 | (with-parsed-tramp-file-name filename nil |
| 3214 | (let ((curbuf (current-buffer)) | 3227 | (let ((curbuf (current-buffer)) |
| 3215 | (copy-program (tramp-get-copy-program | 3228 | (copy-program (tramp-get-method-parameter |
| 3216 | multi-method | 3229 | multi-method |
| 3217 | (tramp-find-method multi-method method user host) | 3230 | (tramp-find-method multi-method method user host) |
| 3218 | user host)) | 3231 | user host 'tramp-copy-program)) |
| 3219 | (copy-args (tramp-get-copy-args | 3232 | (copy-args (tramp-get-method-parameter |
| 3220 | multi-method | 3233 | multi-method |
| 3221 | (tramp-find-method multi-method method user host) | 3234 | (tramp-find-method multi-method method user host) |
| 3222 | user host)) | 3235 | user host 'tramp-copy-args)) |
| 3223 | (rem-enc (tramp-get-remote-encoding multi-method method user host)) | 3236 | (rem-enc (tramp-get-remote-encoding multi-method method user host)) |
| 3224 | (rem-dec (tramp-get-remote-decoding multi-method method user host)) | 3237 | (rem-dec (tramp-get-remote-decoding multi-method method user host)) |
| 3225 | (loc-enc (tramp-get-local-encoding multi-method method user host)) | 3238 | (loc-enc (tramp-get-local-encoding multi-method method user host)) |
| @@ -4402,7 +4415,8 @@ file exists and nonzero exit status otherwise." | |||
| 4402 | 9 "Setting remote shell prompt...done") | 4415 | 9 "Setting remote shell prompt...done") |
| 4403 | ) | 4416 | ) |
| 4404 | (t (tramp-message 5 "Remote `%s' groks tilde expansion, good" | 4417 | (t (tramp-message 5 "Remote `%s' groks tilde expansion, good" |
| 4405 | (tramp-get-remote-sh multi-method method user host)))))) | 4418 | (tramp-get-method-parameter |
| 4419 | multi-method method user host 'tramp-remote-sh)))))) | ||
| 4406 | 4420 | ||
| 4407 | (defun tramp-check-ls-command (multi-method method user host cmd) | 4421 | (defun tramp-check-ls-command (multi-method method user host cmd) |
| 4408 | "Checks whether the given `ls' executable groks `-n'. | 4422 | "Checks whether the given `ls' executable groks `-n'. |
| @@ -4686,15 +4700,15 @@ Maybe the different regular expressions need to be tuned. | |||
| 4686 | (p (apply 'start-process | 4700 | (p (apply 'start-process |
| 4687 | (tramp-buffer-name multi-method method user host) | 4701 | (tramp-buffer-name multi-method method user host) |
| 4688 | (tramp-get-buffer multi-method method user host) | 4702 | (tramp-get-buffer multi-method method user host) |
| 4689 | (tramp-get-login-program | 4703 | (tramp-get-method-parameter |
| 4690 | multi-method | 4704 | multi-method |
| 4691 | (tramp-find-method multi-method method user host) | 4705 | (tramp-find-method multi-method method user host) |
| 4692 | user host) | 4706 | user host 'tramp-login-program) |
| 4693 | host | 4707 | host |
| 4694 | (tramp-get-login-args | 4708 | (tramp-get-method-parameter |
| 4695 | multi-method | 4709 | multi-method |
| 4696 | (tramp-find-method multi-method method user host) | 4710 | (tramp-find-method multi-method method user host) |
| 4697 | user host))) | 4711 | user host 'tramp-login-args))) |
| 4698 | (found nil) | 4712 | (found nil) |
| 4699 | (pw nil)) | 4713 | (pw nil)) |
| 4700 | (process-kill-without-query p) | 4714 | (process-kill-without-query p) |
| @@ -4743,14 +4757,14 @@ arguments, and xx will be used as the host name to connect to. | |||
| 4743 | (let ((process-environment (copy-sequence process-environment)) | 4757 | (let ((process-environment (copy-sequence process-environment)) |
| 4744 | (bufnam (tramp-buffer-name multi-method method user host)) | 4758 | (bufnam (tramp-buffer-name multi-method method user host)) |
| 4745 | (buf (tramp-get-buffer multi-method method user host)) | 4759 | (buf (tramp-get-buffer multi-method method user host)) |
| 4746 | (login-program (tramp-get-login-program | 4760 | (login-program (tramp-get-method-parameter |
| 4747 | multi-method | 4761 | multi-method |
| 4748 | (tramp-find-method multi-method method user host) | 4762 | (tramp-find-method multi-method method user host) |
| 4749 | user host)) | 4763 | user host 'tramp-login-program)) |
| 4750 | (login-args (tramp-get-login-args | 4764 | (login-args (tramp-get-method-parameter |
| 4751 | multi-method | 4765 | multi-method |
| 4752 | (tramp-find-method multi-method method user host) | 4766 | (tramp-find-method multi-method method user host) |
| 4753 | user host))) | 4767 | user host 'tramp-login-args))) |
| 4754 | ;; The following should be changed. We need a more general | 4768 | ;; The following should be changed. We need a more general |
| 4755 | ;; mechanism to parse extra host args. | 4769 | ;; mechanism to parse extra host args. |
| 4756 | (when (string-match "\\([^#]*\\)#\\(.*\\)" host) | 4770 | (when (string-match "\\([^#]*\\)#\\(.*\\)" host) |
| @@ -4818,17 +4832,17 @@ prompt than you do, so it is not at all unlikely that the variable | |||
| 4818 | (p (apply 'start-process | 4832 | (p (apply 'start-process |
| 4819 | (tramp-buffer-name multi-method method user host) | 4833 | (tramp-buffer-name multi-method method user host) |
| 4820 | (tramp-get-buffer multi-method method user host) | 4834 | (tramp-get-buffer multi-method method user host) |
| 4821 | (tramp-get-login-program | 4835 | (tramp-get-method-parameter |
| 4822 | multi-method | 4836 | multi-method |
| 4823 | (tramp-find-method multi-method method user host) | 4837 | (tramp-find-method multi-method method user host) |
| 4824 | user host) | 4838 | user host 'tramp-login-program) |
| 4825 | (mapcar | 4839 | (mapcar |
| 4826 | (lambda (x) | 4840 | (lambda (x) |
| 4827 | (format-spec x `((?u . ,(or user "root"))))) | 4841 | (format-spec x `((?u . ,(or user "root"))))) |
| 4828 | (tramp-get-login-args | 4842 | (tramp-get-method-parameter |
| 4829 | multi-method | 4843 | multi-method |
| 4830 | (tramp-find-method multi-method method user host) | 4844 | (tramp-find-method multi-method method user host) |
| 4831 | user host)))) | 4845 | user host 'tramp-login-args)))) |
| 4832 | (found nil) | 4846 | (found nil) |
| 4833 | (pw nil)) | 4847 | (pw nil)) |
| 4834 | (process-kill-without-query p) | 4848 | (process-kill-without-query p) |
| @@ -5054,11 +5068,13 @@ Uses PROMPT as a prompt and sends the password to process P." | |||
| 5054 | (erase-buffer) | 5068 | (erase-buffer) |
| 5055 | (process-send-string | 5069 | (process-send-string |
| 5056 | p (concat pw | 5070 | p (concat pw |
| 5057 | (tramp-get-password-end-of-line | 5071 | (or (tramp-get-method-parameter |
| 5058 | tramp-current-multi-method | 5072 | tramp-current-multi-method |
| 5059 | tramp-current-method | 5073 | tramp-current-method |
| 5060 | tramp-current-user | 5074 | tramp-current-user |
| 5061 | tramp-current-host))))) | 5075 | tramp-current-host |
| 5076 | 'tramp-password-end-of-line) | ||
| 5077 | tramp-default-password-end-of-line))))) | ||
| 5062 | 5078 | ||
| 5063 | ;; HHH: Not Changed. This might handle the case where USER is not | 5079 | ;; HHH: Not Changed. This might handle the case where USER is not |
| 5064 | ;; given in the "File name" very poorly. Then, the local | 5080 | ;; given in the "File name" very poorly. Then, the local |
| @@ -5101,13 +5117,15 @@ to set up. METHOD, USER and HOST specify the connection." | |||
| 5101 | (tramp-send-command-internal | 5117 | (tramp-send-command-internal |
| 5102 | multi-method method user host | 5118 | multi-method method user host |
| 5103 | (format "exec env 'ENV=' 'PS1=$ ' %s" | 5119 | (format "exec env 'ENV=' 'PS1=$ ' %s" |
| 5104 | (tramp-get-remote-sh multi-method method user host)) | 5120 | (tramp-get-method-parameter |
| 5121 | multi-method method user host 'tramp-remote-sh)) | ||
| 5105 | (format "remote `%s' to come up" | 5122 | (format "remote `%s' to come up" |
| 5106 | (tramp-get-remote-sh multi-method method user host))) | 5123 | (tramp-get-method-parameter |
| 5124 | multi-method method user host 'tramp-remote-sh))) | ||
| 5107 | (tramp-barf-if-no-shell-prompt | 5125 | (tramp-barf-if-no-shell-prompt |
| 5108 | p 30 | 5126 | p 30 |
| 5109 | "Remote `%s' didn't come up. See buffer `%s' for details" | 5127 | "Remote `%s' didn't come up. See buffer `%s' for details" |
| 5110 | (tramp-get-remote-sh multi-method method user host) | 5128 | (tramp-get-method-parameter multi-method method user host 'tramp-remote-sh) |
| 5111 | (buffer-name)) | 5129 | (buffer-name)) |
| 5112 | (tramp-message 8 "Setting up remote shell environment") | 5130 | (tramp-message 8 "Setting up remote shell environment") |
| 5113 | (tramp-discard-garbage-erase-buffer p multi-method method user host) | 5131 | (tramp-discard-garbage-erase-buffer p multi-method method user host) |
| @@ -5287,13 +5305,13 @@ locale to C and sets up the remote shell search path." | |||
| 5287 | multi-method method user host | 5305 | multi-method method user host |
| 5288 | (concat "tramp_file_attributes () {\n" | 5306 | (concat "tramp_file_attributes () {\n" |
| 5289 | tramp-remote-perl | 5307 | tramp-remote-perl |
| 5290 | " -e '" tramp-perl-file-attributes "' $1 2>/dev/null\n" | 5308 | " -e '" tramp-perl-file-attributes "' $1 $2 2>/dev/null\n" |
| 5291 | "}")) | 5309 | "}")) |
| 5292 | (tramp-wait-for-output) | 5310 | (tramp-wait-for-output) |
| 5293 | (unless (tramp-get-copy-program | 5311 | (unless (tramp-get-method-parameter |
| 5294 | multi-method | 5312 | multi-method |
| 5295 | (tramp-find-method multi-method method user host) | 5313 | (tramp-find-method multi-method method user host) |
| 5296 | user host) | 5314 | user host 'tramp-copy-program) |
| 5297 | (tramp-message 5 "Sending the Perl `mime-encode' implementations.") | 5315 | (tramp-message 5 "Sending the Perl `mime-encode' implementations.") |
| 5298 | (tramp-send-string | 5316 | (tramp-send-string |
| 5299 | multi-method method user host | 5317 | multi-method method user host |
| @@ -5332,10 +5350,10 @@ locale to C and sets up the remote shell search path." | |||
| 5332 | (tramp-set-connection-property "ln" ln multi-method method user host))) | 5350 | (tramp-set-connection-property "ln" ln multi-method method user host))) |
| 5333 | (erase-buffer) | 5351 | (erase-buffer) |
| 5334 | ;; Find the right encoding/decoding commands to use. | 5352 | ;; Find the right encoding/decoding commands to use. |
| 5335 | (unless (tramp-get-copy-program | 5353 | (unless (tramp-get-method-parameter |
| 5336 | multi-method | 5354 | multi-method |
| 5337 | (tramp-find-method multi-method method user host) | 5355 | (tramp-find-method multi-method method user host) |
| 5338 | user host) | 5356 | user host 'tramp-copy-program) |
| 5339 | (tramp-find-inline-encoding multi-method method user host)) | 5357 | (tramp-find-inline-encoding multi-method method user host)) |
| 5340 | ;; If encoding/decoding command are given, test to see if they work. | 5358 | ;; If encoding/decoding command are given, test to see if they work. |
| 5341 | ;; CCC: Maybe it would be useful to run the encoder both locally and | 5359 | ;; CCC: Maybe it would be useful to run the encoder both locally and |
| @@ -5548,10 +5566,10 @@ connection if a previous connection has died for some reason." | |||
| 5548 | (unless (and p (processp p) (memq (process-status p) '(run open))) | 5566 | (unless (and p (processp p) (memq (process-status p) '(run open))) |
| 5549 | (when (and p (processp p)) | 5567 | (when (and p (processp p)) |
| 5550 | (delete-process p)) | 5568 | (delete-process p)) |
| 5551 | (funcall (tramp-get-connection-function | 5569 | (funcall (tramp-get-method-parameter |
| 5552 | multi-method | 5570 | multi-method |
| 5553 | (tramp-find-method multi-method method user host) | 5571 | (tramp-find-method multi-method method user host) |
| 5554 | user host) | 5572 | user host 'tramp-connection-function) |
| 5555 | multi-method method user host)))) | 5573 | multi-method method user host)))) |
| 5556 | 5574 | ||
| 5557 | (defun tramp-send-command | 5575 | (defun tramp-send-command |
| @@ -6035,10 +6053,10 @@ If both MULTI-METHOD and METHOD are nil, do a lookup in | |||
| 6035 | "Return t if this is an out-of-band method, nil otherwise. | 6053 | "Return t if this is an out-of-band method, nil otherwise. |
| 6036 | It is important to check for this condition, since it is not possible | 6054 | It is important to check for this condition, since it is not possible |
| 6037 | to enter a password for the `tramp-copy-program'." | 6055 | to enter a password for the `tramp-copy-program'." |
| 6038 | (tramp-get-copy-program | 6056 | (tramp-get-method-parameter |
| 6039 | multi-method | 6057 | multi-method |
| 6040 | (tramp-find-method multi-method method user host) | 6058 | (tramp-find-method multi-method method user host) |
| 6041 | user host)) | 6059 | user host 'tramp-copy-program)) |
| 6042 | 6060 | ||
| 6043 | ;; Variables local to connection. | 6061 | ;; Variables local to connection. |
| 6044 | 6062 | ||
| @@ -6117,65 +6135,19 @@ If the value is not set for the connection, return `default'" | |||
| 6117 | (tramp-get-connection-property "local-decoding" nil | 6135 | (tramp-get-connection-property "local-decoding" nil |
| 6118 | multi-method method user host)) | 6136 | multi-method method user host)) |
| 6119 | 6137 | ||
| 6120 | 6138 | (defun tramp-get-method-parameter (multi-method method user host param) | |
| 6121 | 6139 | "Return the method parameter PARAM. | |
| 6122 | (defun tramp-get-connection-function (multi-method method user host) | 6140 | If the `tramp-methods' entry does not exist, use the variable PARAM |
| 6123 | (second (or (assoc 'tramp-connection-function | 6141 | as default." |
| 6124 | (assoc (tramp-find-method multi-method method user host) | 6142 | (unless (boundp param) |
| 6125 | tramp-methods)) | 6143 | (error "Non-existing method parameter `%s'" param)) |
| 6126 | (error "Method `%s' didn't specify a connection function" | 6144 | (let ((entry (assoc param |
| 6127 | (or multi-method method))))) | ||
| 6128 | |||
| 6129 | (defun tramp-get-remote-sh (multi-method method user host) | ||
| 6130 | (second (or (assoc 'tramp-remote-sh | ||
| 6131 | (assoc (tramp-find-method multi-method method user host) | ||
| 6132 | tramp-methods)) | ||
| 6133 | (error "Method `%s' didn't specify a remote shell" | ||
| 6134 | (or multi-method method))))) | ||
| 6135 | |||
| 6136 | (defun tramp-get-login-program (multi-method method user host) | ||
| 6137 | (second (or (assoc 'tramp-login-program | ||
| 6138 | (assoc (tramp-find-method multi-method method user host) | ||
| 6139 | tramp-methods)) | ||
| 6140 | (error "Method `%s' didn't specify a login program" | ||
| 6141 | (or multi-method method))))) | ||
| 6142 | |||
| 6143 | (defun tramp-get-login-args (multi-method method user host) | ||
| 6144 | (second (or (assoc 'tramp-login-args | ||
| 6145 | (assoc (tramp-find-method multi-method method user host) | ||
| 6146 | tramp-methods)) | ||
| 6147 | (error "Method `%s' didn't specify login args" | ||
| 6148 | (or multi-method method))))) | ||
| 6149 | |||
| 6150 | (defun tramp-get-copy-program (multi-method method user host) | ||
| 6151 | (second (or (assoc 'tramp-copy-program | ||
| 6152 | (assoc (tramp-find-method multi-method method user host) | ||
| 6153 | tramp-methods)) | ||
| 6154 | (error "Method `%s' didn't specify a copy program" | ||
| 6155 | (or multi-method method))))) | ||
| 6156 | |||
| 6157 | (defun tramp-get-copy-args (multi-method method user host) | ||
| 6158 | (second (or (assoc 'tramp-copy-args | ||
| 6159 | (assoc (tramp-find-method multi-method method user host) | ||
| 6160 | tramp-methods)) | ||
| 6161 | (error "Method `%s' didn't specify copy args" | ||
| 6162 | (or multi-method method))))) | ||
| 6163 | |||
| 6164 | (defun tramp-get-copy-keep-date-arg (multi-method method user host) | ||
| 6165 | (second (or (assoc 'tramp-copy-keep-date-arg | ||
| 6166 | (assoc (tramp-find-method multi-method method user host) | ||
| 6167 | tramp-methods)) | ||
| 6168 | (error "Method `%s' didn't specify `keep-date' arg for tramp" | ||
| 6169 | (or multi-method method))))) | ||
| 6170 | |||
| 6171 | (defun tramp-get-password-end-of-line (multi-method method user host) | ||
| 6172 | (let ((entry (assoc 'tramp-password-end-of-line | ||
| 6173 | (assoc (tramp-find-method multi-method method user host) | 6145 | (assoc (tramp-find-method multi-method method user host) |
| 6174 | tramp-methods)))) | 6146 | tramp-methods)))) |
| 6175 | (unless entry | 6147 | (if entry |
| 6176 | (error "Method `%s' didn't specify `password-end-of-line' arg for tramp" | 6148 | (second entry) |
| 6177 | (or multi-method method))) | 6149 | (symbol-value param)))) |
| 6178 | (or (second entry) tramp-default-password-end-of-line))) | 6150 | |
| 6179 | 6151 | ||
| 6180 | ;; Auto saving to a special directory. | 6152 | ;; Auto saving to a special directory. |
| 6181 | 6153 | ||
| @@ -6505,6 +6477,7 @@ report. | |||
| 6505 | 6477 | ||
| 6506 | ;;; TODO: | 6478 | ;;; TODO: |
| 6507 | 6479 | ||
| 6480 | ;; * tramp-copy-keep-date-arg is not used! | ||
| 6508 | ;; * Allow putting passwords in the filename. | 6481 | ;; * Allow putting passwords in the filename. |
| 6509 | ;; This should be implemented via a general mechanism to add | 6482 | ;; This should be implemented via a general mechanism to add |
| 6510 | ;; parameters in filenames. There is currently a kludge for | 6483 | ;; parameters in filenames. There is currently a kludge for |
| @@ -6626,6 +6599,7 @@ report. | |||
| 6626 | ;; ** Enhance variables for debug. | 6599 | ;; ** Enhance variables for debug. |
| 6627 | ;; ** Implement "/multi:" completion. | 6600 | ;; ** Implement "/multi:" completion. |
| 6628 | ;; ** Add a learning mode for completion. Make results persistent. | 6601 | ;; ** Add a learning mode for completion. Make results persistent. |
| 6602 | ;; * Allow out-of-band methods as _last_ multi-hop. | ||
| 6629 | 6603 | ||
| 6630 | ;; Functions for file-name-handler-alist: | 6604 | ;; Functions for file-name-handler-alist: |
| 6631 | ;; diff-latest-backup-file -- in diff.el | 6605 | ;; diff-latest-backup-file -- in diff.el |
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 0e71fe45d9b..72c8c97899a 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run | 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run |
| 31 | ;; "autoconf && ./configure" to change them. | 31 | ;; "autoconf && ./configure" to change them. |
| 32 | 32 | ||
| 33 | (defconst tramp-version "2.0.36" | 33 | (defconst tramp-version "2.0.38" |
| 34 | "This version of Tramp.") | 34 | "This version of Tramp.") |
| 35 | 35 | ||
| 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" | 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" |