summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorKai Großjohann <kgrossjo@eu.uu.net>2003-03-29 15:16:57 +0000
committerKai Großjohann <kgrossjo@eu.uu.net>2003-03-29 15:16:57 +0000
commitb1a2b924ce45cc99bd148afc65637841e88e314b (patch)
tree71a7254ba9aa43491c0e075c43524bd2603df99c /lisp/net
parentef6e365d099f5f2cd75d8ca783436e503fa5dabe (diff)
downloademacs-b1a2b924ce45cc99bd148afc65637841e88e314b.tar.gz
* 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.el46
-rw-r--r--lisp/net/tramp.el90
-rw-r--r--lisp/net/trampver.el41
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)."
;; They should have the format
;;
;; \s-\{2,2} - leading spaces
-;; \S-\(.*\S-\)\s-* - file name, 32 chars, left bound
+;; \S-\(.*\S-\)\s-* - file name, 30 chars, left bound
+;; \s-+[ADHRSV]* - permissions, 7 chars, right bound
;; \s- - space delimeter
-;; \s-*[ADHRS]* - permissions, 5 chars, right bound
-;; \s- - space delimeter
-;; \s-*[0-9]+ - size, 8 (Samba) or 7 (Windows)
-;; chars, right bound
+;; \s-+[0-9]+ - size, 8 chars, right bound
;; \s-\{2,2\} - space delimeter
;; \w\{3,3\} - weekday
;; \s- - space delimeter
+;; \w\{3,3\} - month
+;; \s- - space delimeter
;; [ 19][0-9] - day
;; \s- - space delimeter
;; [0-9]\{2,2\}:[0-9]\{2,2\}:[0-9]\{2,2\} - time
;; \s- - space delimeter
;; [0-9]\{4,4\} - year
;;
+;; samba/src/client.c (http://samba.org/doxygen/samba/client_8c-source.html)
+;; has function display_finfo:
+;;
+;; d_printf(" %-30s%7.7s %8.0f %s",
+;; finfo->name,
+;; attrib_string(finfo->mode),
+;; (double)finfo->size,
+;; asctime(LocalTime(&t)));
+;;
+;; in Samba 1.9, there's the following code:
+;;
+;; DEBUG(0,(" %-30s%7.7s%10d %s",
+;; CNV_LANG(finfo->name),
+;; attrib_string(finfo->mode),
+;; finfo->size,
+;; asctime(LocalTime(&t))));
+;;
;; Problems:
;; * Modern regexp constructs, like spy groups and counted repetitions, aren't
;; available in older Emacsen.
@@ -828,27 +845,28 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
;; size
(if (string-match "\\([0-9]+\\)$" line)
- (setq
- size (string-to-number (match-string 1 line))
- line (substring
- line 0 (- (max 8 (1+ (length (match-string 1 line)))))))
+ (let ((length (- (max 10 (1+ (length (match-string 1 line)))))))
+ (setq size (string-to-number (match-string 1 line)))
+ (when (string-match "\\([ADHRSV]+\\)" (substring line length))
+ (setq length (+ length (match-end 0))))
+ (setq line (substring line 0 length)))
(return))
- ;; mode
- (if (string-match "\\(\\([ADHRS]+\\)?\\s-?\\)$" line)
+ ;; mode: ARCH, DIR, HIDDEN, RONLY, SYSTEM, VOLID
+ (if (string-match "\\([ADHRSV]+\\)?$" line)
(setq
- mode (or (match-string 2 line) "")
+ mode (or (match-string 1 line) "")
mode (save-match-data (format
"%s%s"
(if (string-match "D" mode) "d" "-")
(mapconcat
(lambda (x) "") " "
(concat "r" (if (string-match "R" mode) "-" "w") "x"))))
- line (substring line 0 (- (1+ (length (match-string 2 line))))))
+ line (substring line 0 -7))
(return))
;; localname
- (if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-+$" line)
+ (if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-*$" line)
(setq localname (match-string 1 line))
(return))))
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 @@
-;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- coding: iso-8859-1; -*-
+;;; -*- mode: Emacs-Lisp; coding: iso-8859-1; -*-
+;;; tramp.el --- Transparent Remote Access, Multiple Protocol
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-;; Author: Kai.Grossjohann@CS.Uni-Dortmund.DE
+;; Author: kai.grossjohann@gmx.net
;; Keywords: comm, processes
;; This file is part of GNU Emacs.
@@ -29,8 +30,7 @@
;; the local and the remote host, whereas tramp.el uses a combination
;; of rsh and rcp or other work-alike programs, such as ssh/scp.
;;
-;; For more detailed instructions, please see the info file, which is
-;; included in the file `tramp.tar.gz' mentioned below.
+;; For more detailed instructions, please see the info file.
;;
;; Notes:
;; -----
@@ -46,13 +46,11 @@
;;
;; Also see the todo list at the bottom of this file.
;;
-;; The current version of tramp.el can be retrieved from the following
-;; URL: ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz
-;; For your convenience, the *.el file is available separately from
-;; the same directory.
+;; The current version of Tramp can be retrieved from the following URL:
+;; http://savannah.nongnu.org/download/tramp/
;;
;; There's a mailing list for this, as well. Its name is:
-;; tramp-devel@mail.freesoftware.fsf.org
+;; tramp-devel@mail.freesoftware.fsf.org
;; Send a mail with `help' in the subject (!) to the administration
;; address for instructions on joining the list. The administration
;; address is:
@@ -69,14 +67,8 @@
;;; Code:
-;; In the Tramp CVS repository, the version numer is auto-frobbed from
-;; the Makefile, so you should edit the top-level Makefile to change
-;; the version number.
-(defconst tramp-version "2.0.30"
- "This version of tramp.")
-
-(defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org"
- "Email address to send bug reports to.")
+;; The Tramp version number and bug report address, as prepared by configure.
+(require 'trampver)
(require 'timer)
(require 'format-spec) ;from Gnus 5.8, also in tar ball
@@ -1275,7 +1267,7 @@ checked via the following code:
Please raise a bug report via \"M-x tramp-bug\" if your system needs
this variable to be set as well."
:group 'tramp
- :type 'integer)
+ :type '(choice (const nil) integer))
;;; Internal Variables:
@@ -2831,6 +2823,10 @@ This is like `dired-recursive-delete-directory' for tramp files."
(file-name-nondirectory localname)))))
(sit-for 1) ;needed for rsh but not ssh?
(tramp-wait-for-output))
+ ;; The following let-binding is used by code that's commented
+ ;; out. Let's leave the let-binding in for a while to see
+ ;; that the commented-out code is really not needed. Commenting-out
+ ;; happened on 2003-03-13.
(let ((old-pos (point)))
(insert-buffer-substring
(tramp-get-buffer multi-method method user host))
@@ -2843,13 +2839,16 @@ This is like `dired-recursive-delete-directory' for tramp files."
(save-excursion
(tramp-send-command multi-method method user host "cd")
(tramp-wait-for-output))
- ;; Another XEmacs specialty follows. What's the right way to do
- ;; it?
- (when (and (featurep 'xemacs)
- (eq major-mode 'dired-mode))
- (save-excursion
- (require 'dired)
- (dired-insert-set-properties old-pos (point)))))))
+ ;; For the time being, the XEmacs kludge is commented out.
+ ;; Please test it on various XEmacs versions to see if it works.
+;; ;; Another XEmacs specialty follows. What's the right way to do
+;; ;; it?
+;; (when (and (featurep 'xemacs)
+;; (eq major-mode 'dired-mode))
+;; (save-excursion
+;; (require 'dired)
+;; (dired-insert-set-properties old-pos (point))))
+ )))
;; Continuation of kluge to pacify byte-compiler.
;;(eval-when-compile
@@ -2917,20 +2916,33 @@ the result will be a local, non-Tramp, filename."
(setq uname (buffer-substring (point) (tramp-line-end-position)))
(setq localname (concat uname fname))
(erase-buffer)))
- ;; Look if localname starts with "/../" construct. If this is
- ;; the case, then we return a local name instead of a remote name.
- (if (string-match "^/\\.\\./" localname)
- (expand-file-name (substring localname 3))
- ;; No tilde characters in file name, do normal
- ;; expand-file-name (this does "/./" and "/../"). We bind
- ;; directory-sep-char here for XEmacs on Windows, which
- ;; would otherwise use backslash.
- (let ((directory-sep-char ?/))
- (tramp-make-tramp-file-name
- multi-method method user host
- (tramp-drop-volume-letter
- (tramp-run-real-handler 'expand-file-name
- (list localname))))))))))
+ ;; No tilde characters in file name, do normal
+ ;; expand-file-name (this does "/./" and "/../"). We bind
+ ;; directory-sep-char here for XEmacs on Windows, which
+ ;; would otherwise use backslash.
+ (let ((directory-sep-char ?/))
+ (tramp-make-tramp-file-name
+ multi-method method user host
+ (tramp-drop-volume-letter
+ (tramp-run-real-handler 'expand-file-name
+ (list localname)))))))))
+
+;; old version follows. it uses ".." to cross file handler
+;; boundaries.
+;; ;; Look if localname starts with "/../" construct. If this is
+;; ;; the case, then we return a local name instead of a remote name.
+;; (if (string-match "^/\\.\\./" localname)
+;; (expand-file-name (substring localname 3))
+;; ;; No tilde characters in file name, do normal
+;; ;; expand-file-name (this does "/./" and "/../"). We bind
+;; ;; directory-sep-char here for XEmacs on Windows, which
+;; ;; would otherwise use backslash.
+;; (let ((directory-sep-char ?/))
+;; (tramp-make-tramp-file-name
+;; multi-method method user host
+;; (tramp-drop-volume-letter
+;; (tramp-run-real-handler 'expand-file-name
+;; (list localname))))))))))
;; Remote commands.
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 @@
+;;; -*- mode: Emacs-Lisp; coding: iso-8859-1; -*-
+;;; trampver.el --- Transparent Remote Access, Multiple Protocol
+;;; lisp/trampver.el. Generated from trampver.el.in by configure.
+
+;; Copyright (C) 2003 Free Software Foundation, Inc.
+
+;; Author: Kai.Grossjohann@CS.Uni-Dortmund.DE
+;; Keywords: comm, processes
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Code:
+
+;; In the Tramp CVS repository, the version numer and the bug report address
+;; are auto-frobbed from configure.ac, so you should edit that file and run
+;; "autoconf && ./configure" to change them.
+
+(defconst tramp-version "2.0.31"
+ "This version of Tramp.")
+
+(defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org"
+ "Email address to send bug reports to.")
+
+(provide 'trampver)
+
+;;; trampver.el ends here