]> code.delx.au - gnu-emacs/commitdiff
Sync with Tramp 2.0.45.
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 12 Oct 2004 21:02:43 +0000 (21:02 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 12 Oct 2004 21:02:43 +0000 (21:02 +0000)
lisp/ChangeLog
lisp/net/tramp-smb.el
lisp/net/tramp.el
lisp/net/trampver.el
man/ChangeLog
man/tramp.texi
man/trampver.texi

index dbc13ea927b8a5aebecb63f2186eb7efc24fa1a1..06b7ebd0d49431125c72bf662798774bf1e72717 100644 (file)
@@ -1,3 +1,23 @@
+2004-10-12  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.0.45.
+
+       * net/tramp.el (top): Apply `def-edebug-spec' only if function is
+       defined.  This is not the case for XEmacs without package
+       "edebug".
+       (tramp-set-auto-save-file-modes): Set permissions of autosaved
+       remote files to the permissions of the original file.  This is not
+       the case for Emacs < 21.3.50 and XEmacs < 21.5.  Add function to
+       `auto-save-hook'.  Reported by Thomas Prokosch <thomas@nadev.net>.
+       (tramp-perl-decode): Fixed an error in Perl implementation.
+       $pending must be cleared every loop.  Reported by Benjamin Place
+       <benjaminplace@sprintmail.com>
+
+       * net/tramp-smb.el (tramp-smb-advice-PC-do-completion): Don't
+       activate advice during definition.  This is done later on,
+       depending on test result of `substitute-in-file-name'.  Suggested
+       by Stefan Monnier <monnier@iro.umontreal.ca>.
+
 2004-10-12  David Ponce  <david@dponce.com>
 
        * recentf.el (recentf-edit-list): Update the menu when the recentf
index 6a888d9d75d6f553a9db309fc46d7ca56d198ca5..4628af881789f8b5840b794d20fd2a65a3bd606a 100644 (file)
@@ -1087,7 +1087,7 @@ Return the difference in the format of a time value."
 ;; `PC-do-completion' touches the returning "$$" by `substitute-in-file-name'.
 ;; Must be corrected.
 
-(defadvice PC-do-completion (around tramp-smb-advice-PC-do-completion activate)
+(defadvice PC-do-completion (around tramp-smb-advice-PC-do-completion)
   "Changes \"$\" back to \"$$\" in minibuffer."
   (if (funcall PC-completion-as-file-name-predicate)
 
@@ -1123,6 +1123,13 @@ Return the difference in the format of a time value."
     ;; No file names. Behave unchanged.
     ad-do-it))
 
+;; Activate advice.  Recent Emacsen don't need that.
+(when (functionp 'PC-do-completion)
+  (condition-case nil
+      (substitute-in-file-name "C$/")
+    (error
+     (ad-activate 'PC-do-completion))))
+
 (provide 'tramp-smb)
 
 ;;; TODO:
index cda0d41fd8df12c91e6dd7f8dd8c1d4f90369778..a30280dbd4f4ef5016402d87f113a5dbb5174d23 100644 (file)
@@ -1668,6 +1668,7 @@ while (my $data = <STDIN>) {
 
     my $len = length($pending);
     my $chunk = substr($pending, 0, $len & ~3);
+    $pending = substr($pending, $len & ~3 + 1);
 
     # Easy method: translate from chars to (pregenerated) six-bit packets, join,
     # split in 8-bit chunks and convert back to char.
@@ -1883,7 +1884,11 @@ If VAR is nil, then we bind `v' to the structure and `multi-method',
 
 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
 ;; To be activated for debugging containing this macro
-(def-edebug-spec with-parsed-tramp-file-name t)
+;; It works only when VAR is nil.  Otherwise, it can be deactivated by
+;; (def-edebug-spec with-parsed-tramp-file-name 0)
+;; I'm too stupid to write a precise SPEC for it.
+(if (functionp 'def-edebug-spec)
+  (def-edebug-spec with-parsed-tramp-file-name t))
 
 (defmacro tramp-let-maybe (variable value &rest body)
   "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
@@ -6731,6 +6736,31 @@ as default."
             (tramp-make-auto-save-file-name (buffer-file-name)))
     ad-do-it))
 
+;; In Emacs < 21.4 and XEmacs < 21.5 autosaved remote files have
+;; permission 666 minus umask. This is a security threat.
+
+(defun tramp-set-auto-save-file-modes ()
+  "Set permissions of autosaved remote files to the original permissions."
+  (let ((bfn (buffer-file-name)))
+    (when (and (stringp bfn)
+              (tramp-tramp-file-p bfn)
+              (stringp buffer-auto-save-file-name)
+              (not (equal bfn buffer-auto-save-file-name))
+              (not (file-exists-p buffer-auto-save-file-name)))
+      (write-region "" nil buffer-auto-save-file-name)
+      (set-file-modes buffer-auto-save-file-name (file-modes bfn)))))
+
+(unless (or (> emacs-major-version 21)
+           (and (featurep 'xemacs)
+                (= emacs-major-version 21)
+                (> emacs-minor-version 4))
+           (and (not (featurep 'xemacs))
+                (= emacs-major-version 21)
+                (or (> emacs-minor-version 3)
+                    (and (string-match "^21\\.3\\.\\([0-9]+\\)" emacs-version)
+                         (>= (string-to-int (match-string 1 emacs-version)) 50)))))
+  (add-hook 'auto-save-hook 'tramp-set-auto-save-file-modes))
+
 (defun tramp-subst-strs-in-string (alist string)
   "Replace all occurrences of the string FROM with TO in STRING.
 ALIST is of the form ((FROM . TO) ...)."
index 46b33b2d50f49dc4051ee66e950a1303374a1e1b..7456bc1660fbf24ea00cfe489c088d4c15acfd2e 100644 (file)
@@ -30,7 +30,7 @@
 ;; are auto-frobbed from configure.ac, so you should edit that file and run
 ;; "autoconf && ./configure" to change them.
 
-(defconst tramp-version "2.0.44"
+(defconst tramp-version "2.0.45"
   "This version of Tramp.")
 
 (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org"
index c996722b444a579f229b417c4895adc23f14880c..09308d99ba6ebfbd6d992d3f03ec3d9dca19d88a 100644 (file)
@@ -1,3 +1,11 @@
+2004-10-12  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.0.45.
+
+       * tramp.texi (Frequently Asked Questions): Comment paragraph about
+       plink link.  The URL is outdated.  Originator contacted for
+       clarification.
+
 2004-10-10  Juri Linkov  <juri@jurta.org>
 
        * gnus.texi (Top, Marking Articles): Join two menus in one node
index ebba03d6260772cfb46562f1eab1b309b1b5e78c..e8577af49824dac93b91d9a43c73b85a7ef948f2 100644 (file)
@@ -1952,9 +1952,12 @@ There is some informations on @value{tramp} on NT at the following URL;
 many thanks to Joe Stoy for providing the information:
 @uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/}
 
+@c The link is broken. I've contacted Tom for clarification. Michael.
+@ignore
 The above mostly contains patches to old ssh versions; Tom Roche has a
 Web page with instructions:
 @uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html}
+@end ignore
 
 ??? Is the XEmacs info correct?
 
index a5cc874b3fb2cc13044780acf70a52a90004f734..743b49388f796c7c1c28b1a2173caa4e5d8d32ac 100644 (file)
@@ -4,7 +4,7 @@
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.0.44
+@set trampver 2.0.45
 
 @c Other flags from configuration
 @set prefix /usr/local