diff options
| author | Kai Großjohann | 2003-03-29 15:16:57 +0000 |
|---|---|---|
| committer | Kai Großjohann | 2003-03-29 15:16:57 +0000 |
| commit | b1a2b924ce45cc99bd148afc65637841e88e314b (patch) | |
| tree | 71a7254ba9aa43491c0e075c43524bd2603df99c /lisp/net | |
| parent | ef6e365d099f5f2cd75d8ca783436e503fa5dabe (diff) | |
| download | emacs-b1a2b924ce45cc99bd148afc65637841e88e314b.tar.gz emacs-b1a2b924ce45cc99bd148afc65637841e88e314b.zip | |
* tramp.el: Version 2.0.31 released.
(tramp-handle-expand-file-name): Do not allow ".." to
cross file handler boundaries, so that "/user@host:/../foo"
expands to itself, rather than "/foo". This is intended to work
in conjunction with a change in `file-relative-name' which makes
sure to use absolute file names if FILE and DIRECTORY have
different handlers.
(tramp-handle-insert-directory): Comment out XEmacs
kludge. Suggested by Katsumi Yamaoka <yamaoka@jpl.org>.
* Makefile.in (../info/tramp): Compile Emacs, instead of XEmacs,
version of manual.
* tramp.texi (Auto-save and Backup): New node.
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/tramp-smb.el | 46 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 90 | ||||
| -rw-r--r-- | lisp/net/trampver.el | 41 |
3 files changed, 124 insertions, 53 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index df3d9716cc5..8474b7a88a3 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -754,21 +754,38 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." | |||
| 754 | ;; They should have the format | 754 | ;; They should have the format |
| 755 | ;; | 755 | ;; |
| 756 | ;; \s-\{2,2} - leading spaces | 756 | ;; \s-\{2,2} - leading spaces |
| 757 | ;; \S-\(.*\S-\)\s-* - file name, 32 chars, left bound | 757 | ;; \S-\(.*\S-\)\s-* - file name, 30 chars, left bound |
| 758 | ;; \s-+[ADHRSV]* - permissions, 7 chars, right bound | ||
| 758 | ;; \s- - space delimeter | 759 | ;; \s- - space delimeter |
| 759 | ;; \s-*[ADHRS]* - permissions, 5 chars, right bound | 760 | ;; \s-+[0-9]+ - size, 8 chars, right bound |
| 760 | ;; \s- - space delimeter | ||
| 761 | ;; \s-*[0-9]+ - size, 8 (Samba) or 7 (Windows) | ||
| 762 | ;; chars, right bound | ||
| 763 | ;; \s-\{2,2\} - space delimeter | 761 | ;; \s-\{2,2\} - space delimeter |
| 764 | ;; \w\{3,3\} - weekday | 762 | ;; \w\{3,3\} - weekday |
| 765 | ;; \s- - space delimeter | 763 | ;; \s- - space delimeter |
| 764 | ;; \w\{3,3\} - month | ||
| 765 | ;; \s- - space delimeter | ||
| 766 | ;; [ 19][0-9] - day | 766 | ;; [ 19][0-9] - day |
| 767 | ;; \s- - space delimeter | 767 | ;; \s- - space delimeter |
| 768 | ;; [0-9]\{2,2\}:[0-9]\{2,2\}:[0-9]\{2,2\} - time | 768 | ;; [0-9]\{2,2\}:[0-9]\{2,2\}:[0-9]\{2,2\} - time |
| 769 | ;; \s- - space delimeter | 769 | ;; \s- - space delimeter |
| 770 | ;; [0-9]\{4,4\} - year | 770 | ;; [0-9]\{4,4\} - year |
| 771 | ;; | 771 | ;; |
| 772 | ;; samba/src/client.c (http://samba.org/doxygen/samba/client_8c-source.html) | ||
| 773 | ;; has function display_finfo: | ||
| 774 | ;; | ||
| 775 | ;; d_printf(" %-30s%7.7s %8.0f %s", | ||
| 776 | ;; finfo->name, | ||
| 777 | ;; attrib_string(finfo->mode), | ||
| 778 | ;; (double)finfo->size, | ||
| 779 | ;; asctime(LocalTime(&t))); | ||
| 780 | ;; | ||
| 781 | ;; in Samba 1.9, there's the following code: | ||
| 782 | ;; | ||
| 783 | ;; DEBUG(0,(" %-30s%7.7s%10d %s", | ||
| 784 | ;; CNV_LANG(finfo->name), | ||
| 785 | ;; attrib_string(finfo->mode), | ||
| 786 | ;; finfo->size, | ||
| 787 | ;; asctime(LocalTime(&t)))); | ||
| 788 | ;; | ||
| 772 | ;; Problems: | 789 | ;; Problems: |
| 773 | ;; * Modern regexp constructs, like spy groups and counted repetitions, aren't | 790 | ;; * Modern regexp constructs, like spy groups and counted repetitions, aren't |
| 774 | ;; available in older Emacsen. | 791 | ;; available in older Emacsen. |
| @@ -828,27 +845,28 @@ Result is the list (LOCALNAME MODE SIZE MTIME)." | |||
| 828 | 845 | ||
| 829 | ;; size | 846 | ;; size |
| 830 | (if (string-match "\\([0-9]+\\)$" line) | 847 | (if (string-match "\\([0-9]+\\)$" line) |
| 831 | (setq | 848 | (let ((length (- (max 10 (1+ (length (match-string 1 line))))))) |
| 832 | size (string-to-number (match-string 1 line)) | 849 | (setq size (string-to-number (match-string 1 line))) |
| 833 | line (substring | 850 | (when (string-match "\\([ADHRSV]+\\)" (substring line length)) |
| 834 | line 0 (- (max 8 (1+ (length (match-string 1 line))))))) | 851 | (setq length (+ length (match-end 0)))) |
| 852 | (setq line (substring line 0 length))) | ||
| 835 | (return)) | 853 | (return)) |
| 836 | 854 | ||
| 837 | ;; mode | 855 | ;; mode: ARCH, DIR, HIDDEN, RONLY, SYSTEM, VOLID |
| 838 | (if (string-match "\\(\\([ADHRS]+\\)?\\s-?\\)$" line) | 856 | (if (string-match "\\([ADHRSV]+\\)?$" line) |
| 839 | (setq | 857 | (setq |
| 840 | mode (or (match-string 2 line) "") | 858 | mode (or (match-string 1 line) "") |
| 841 | mode (save-match-data (format | 859 | mode (save-match-data (format |
| 842 | "%s%s" | 860 | "%s%s" |
| 843 | (if (string-match "D" mode) "d" "-") | 861 | (if (string-match "D" mode) "d" "-") |
| 844 | (mapconcat | 862 | (mapconcat |
| 845 | (lambda (x) "") " " | 863 | (lambda (x) "") " " |
| 846 | (concat "r" (if (string-match "R" mode) "-" "w") "x")))) | 864 | (concat "r" (if (string-match "R" mode) "-" "w") "x")))) |
| 847 | line (substring line 0 (- (1+ (length (match-string 2 line)))))) | 865 | line (substring line 0 -7)) |
| 848 | (return)) | 866 | (return)) |
| 849 | 867 | ||
| 850 | ;; localname | 868 | ;; localname |
| 851 | (if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-+$" line) | 869 | (if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-*$" line) |
| 852 | (setq localname (match-string 1 line)) | 870 | (setq localname (match-string 1 line)) |
| 853 | (return)))) | 871 | (return)))) |
| 854 | 872 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index dcdaa49b1c5..5bfe55575e8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- coding: iso-8859-1; -*- | 1 | ;;; -*- mode: Emacs-Lisp; coding: iso-8859-1; -*- |
| 2 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol | ||
| 2 | 3 | ||
| 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | 4 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
| 4 | 5 | ||
| 5 | ;; Author: Kai.Grossjohann@CS.Uni-Dortmund.DE | 6 | ;; Author: kai.grossjohann@gmx.net |
| 6 | ;; Keywords: comm, processes | 7 | ;; Keywords: comm, processes |
| 7 | 8 | ||
| 8 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| @@ -29,8 +30,7 @@ | |||
| 29 | ;; the local and the remote host, whereas tramp.el uses a combination | 30 | ;; the local and the remote host, whereas tramp.el uses a combination |
| 30 | ;; of rsh and rcp or other work-alike programs, such as ssh/scp. | 31 | ;; of rsh and rcp or other work-alike programs, such as ssh/scp. |
| 31 | ;; | 32 | ;; |
| 32 | ;; For more detailed instructions, please see the info file, which is | 33 | ;; For more detailed instructions, please see the info file. |
| 33 | ;; included in the file `tramp.tar.gz' mentioned below. | ||
| 34 | ;; | 34 | ;; |
| 35 | ;; Notes: | 35 | ;; Notes: |
| 36 | ;; ----- | 36 | ;; ----- |
| @@ -46,13 +46,11 @@ | |||
| 46 | ;; | 46 | ;; |
| 47 | ;; Also see the todo list at the bottom of this file. | 47 | ;; Also see the todo list at the bottom of this file. |
| 48 | ;; | 48 | ;; |
| 49 | ;; The current version of tramp.el can be retrieved from the following | 49 | ;; The current version of Tramp can be retrieved from the following URL: |
| 50 | ;; URL: ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz | 50 | ;; http://savannah.nongnu.org/download/tramp/ |
| 51 | ;; For your convenience, the *.el file is available separately from | ||
| 52 | ;; the same directory. | ||
| 53 | ;; | 51 | ;; |
| 54 | ;; There's a mailing list for this, as well. Its name is: | 52 | ;; There's a mailing list for this, as well. Its name is: |
| 55 | ;; tramp-devel@mail.freesoftware.fsf.org | 53 | ;; tramp-devel@mail.freesoftware.fsf.org |
| 56 | ;; Send a mail with `help' in the subject (!) to the administration | 54 | ;; Send a mail with `help' in the subject (!) to the administration |
| 57 | ;; address for instructions on joining the list. The administration | 55 | ;; address for instructions on joining the list. The administration |
| 58 | ;; address is: | 56 | ;; address is: |
| @@ -69,14 +67,8 @@ | |||
| 69 | 67 | ||
| 70 | ;;; Code: | 68 | ;;; Code: |
| 71 | 69 | ||
| 72 | ;; In the Tramp CVS repository, the version numer is auto-frobbed from | 70 | ;; The Tramp version number and bug report address, as prepared by configure. |
| 73 | ;; the Makefile, so you should edit the top-level Makefile to change | 71 | (require 'trampver) |
| 74 | ;; the version number. | ||
| 75 | (defconst tramp-version "2.0.30" | ||
| 76 | "This version of tramp.") | ||
| 77 | |||
| 78 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" | ||
| 79 | "Email address to send bug reports to.") | ||
| 80 | 72 | ||
| 81 | (require 'timer) | 73 | (require 'timer) |
| 82 | (require 'format-spec) ;from Gnus 5.8, also in tar ball | 74 | (require 'format-spec) ;from Gnus 5.8, also in tar ball |
| @@ -1275,7 +1267,7 @@ checked via the following code: | |||
| 1275 | Please raise a bug report via \"M-x tramp-bug\" if your system needs | 1267 | Please raise a bug report via \"M-x tramp-bug\" if your system needs |
| 1276 | this variable to be set as well." | 1268 | this variable to be set as well." |
| 1277 | :group 'tramp | 1269 | :group 'tramp |
| 1278 | :type 'integer) | 1270 | :type '(choice (const nil) integer)) |
| 1279 | 1271 | ||
| 1280 | ;;; Internal Variables: | 1272 | ;;; Internal Variables: |
| 1281 | 1273 | ||
| @@ -2831,6 +2823,10 @@ This is like `dired-recursive-delete-directory' for tramp files." | |||
| 2831 | (file-name-nondirectory localname))))) | 2823 | (file-name-nondirectory localname))))) |
| 2832 | (sit-for 1) ;needed for rsh but not ssh? | 2824 | (sit-for 1) ;needed for rsh but not ssh? |
| 2833 | (tramp-wait-for-output)) | 2825 | (tramp-wait-for-output)) |
| 2826 | ;; The following let-binding is used by code that's commented | ||
| 2827 | ;; out. Let's leave the let-binding in for a while to see | ||
| 2828 | ;; that the commented-out code is really not needed. Commenting-out | ||
| 2829 | ;; happened on 2003-03-13. | ||
| 2834 | (let ((old-pos (point))) | 2830 | (let ((old-pos (point))) |
| 2835 | (insert-buffer-substring | 2831 | (insert-buffer-substring |
| 2836 | (tramp-get-buffer multi-method method user host)) | 2832 | (tramp-get-buffer multi-method method user host)) |
| @@ -2843,13 +2839,16 @@ This is like `dired-recursive-delete-directory' for tramp files." | |||
| 2843 | (save-excursion | 2839 | (save-excursion |
| 2844 | (tramp-send-command multi-method method user host "cd") | 2840 | (tramp-send-command multi-method method user host "cd") |
| 2845 | (tramp-wait-for-output)) | 2841 | (tramp-wait-for-output)) |
| 2846 | ;; Another XEmacs specialty follows. What's the right way to do | 2842 | ;; For the time being, the XEmacs kludge is commented out. |
| 2847 | ;; it? | 2843 | ;; Please test it on various XEmacs versions to see if it works. |
| 2848 | (when (and (featurep 'xemacs) | 2844 | ;; ;; Another XEmacs specialty follows. What's the right way to do |
| 2849 | (eq major-mode 'dired-mode)) | 2845 | ;; ;; it? |
| 2850 | (save-excursion | 2846 | ;; (when (and (featurep 'xemacs) |
| 2851 | (require 'dired) | 2847 | ;; (eq major-mode 'dired-mode)) |
| 2852 | (dired-insert-set-properties old-pos (point))))))) | 2848 | ;; (save-excursion |
| 2849 | ;; (require 'dired) | ||
| 2850 | ;; (dired-insert-set-properties old-pos (point)))) | ||
| 2851 | ))) | ||
| 2853 | 2852 | ||
| 2854 | ;; Continuation of kluge to pacify byte-compiler. | 2853 | ;; Continuation of kluge to pacify byte-compiler. |
| 2855 | ;;(eval-when-compile | 2854 | ;;(eval-when-compile |
| @@ -2917,20 +2916,33 @@ the result will be a local, non-Tramp, filename." | |||
| 2917 | (setq uname (buffer-substring (point) (tramp-line-end-position))) | 2916 | (setq uname (buffer-substring (point) (tramp-line-end-position))) |
| 2918 | (setq localname (concat uname fname)) | 2917 | (setq localname (concat uname fname)) |
| 2919 | (erase-buffer))) | 2918 | (erase-buffer))) |
| 2920 | ;; Look if localname starts with "/../" construct. If this is | 2919 | ;; No tilde characters in file name, do normal |
| 2921 | ;; the case, then we return a local name instead of a remote name. | 2920 | ;; expand-file-name (this does "/./" and "/../"). We bind |
| 2922 | (if (string-match "^/\\.\\./" localname) | 2921 | ;; directory-sep-char here for XEmacs on Windows, which |
| 2923 | (expand-file-name (substring localname 3)) | 2922 | ;; would otherwise use backslash. |
| 2924 | ;; No tilde characters in file name, do normal | 2923 | (let ((directory-sep-char ?/)) |
| 2925 | ;; expand-file-name (this does "/./" and "/../"). We bind | 2924 | (tramp-make-tramp-file-name |
| 2926 | ;; directory-sep-char here for XEmacs on Windows, which | 2925 | multi-method method user host |
| 2927 | ;; would otherwise use backslash. | 2926 | (tramp-drop-volume-letter |
| 2928 | (let ((directory-sep-char ?/)) | 2927 | (tramp-run-real-handler 'expand-file-name |
| 2929 | (tramp-make-tramp-file-name | 2928 | (list localname))))))))) |
| 2930 | multi-method method user host | 2929 | |
| 2931 | (tramp-drop-volume-letter | 2930 | ;; old version follows. it uses ".." to cross file handler |
| 2932 | (tramp-run-real-handler 'expand-file-name | 2931 | ;; boundaries. |
| 2933 | (list localname)))))))))) | 2932 | ;; ;; Look if localname starts with "/../" construct. If this is |
| 2933 | ;; ;; the case, then we return a local name instead of a remote name. | ||
| 2934 | ;; (if (string-match "^/\\.\\./" localname) | ||
| 2935 | ;; (expand-file-name (substring localname 3)) | ||
| 2936 | ;; ;; No tilde characters in file name, do normal | ||
| 2937 | ;; ;; expand-file-name (this does "/./" and "/../"). We bind | ||
| 2938 | ;; ;; directory-sep-char here for XEmacs on Windows, which | ||
| 2939 | ;; ;; would otherwise use backslash. | ||
| 2940 | ;; (let ((directory-sep-char ?/)) | ||
| 2941 | ;; (tramp-make-tramp-file-name | ||
| 2942 | ;; multi-method method user host | ||
| 2943 | ;; (tramp-drop-volume-letter | ||
| 2944 | ;; (tramp-run-real-handler 'expand-file-name | ||
| 2945 | ;; (list localname)))))))))) | ||
| 2934 | 2946 | ||
| 2935 | ;; Remote commands. | 2947 | ;; Remote commands. |
| 2936 | 2948 | ||
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el new file mode 100644 index 00000000000..48d8123a9dd --- /dev/null +++ b/lisp/net/trampver.el | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | ;;; -*- mode: Emacs-Lisp; coding: iso-8859-1; -*- | ||
| 2 | ;;; trampver.el --- Transparent Remote Access, Multiple Protocol | ||
| 3 | ;;; lisp/trampver.el. Generated from trampver.el.in by configure. | ||
| 4 | |||
| 5 | ;; Copyright (C) 2003 Free Software Foundation, Inc. | ||
| 6 | |||
| 7 | ;; Author: Kai.Grossjohann@CS.Uni-Dortmund.DE | ||
| 8 | ;; Keywords: comm, processes | ||
| 9 | |||
| 10 | ;; This file is part of GNU Emacs. | ||
| 11 | |||
| 12 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 13 | ;; it under the terms of the GNU General Public License as published by | ||
| 14 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 15 | ;; any later version. | ||
| 16 | |||
| 17 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | ;; GNU General Public License for more details. | ||
| 21 | |||
| 22 | ;; You should have received a copy of the GNU General Public License | ||
| 23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 24 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 25 | ;; Boston, MA 02111-1307, USA. | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | ;; In the Tramp CVS repository, the version numer and the bug report address | ||
| 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run | ||
| 31 | ;; "autoconf && ./configure" to change them. | ||
| 32 | |||
| 33 | (defconst tramp-version "2.0.31" | ||
| 34 | "This version of Tramp.") | ||
| 35 | |||
| 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" | ||
| 37 | "Email address to send bug reports to.") | ||
| 38 | |||
| 39 | (provide 'trampver) | ||
| 40 | |||
| 41 | ;;; trampver.el ends here | ||