]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-sh.el (tramp-do-copy-or-rename-file-directly): In the
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 25 Mar 2014 09:49:37 +0000 (10:49 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 25 Mar 2014 09:49:37 +0000 (10:49 +0100)
`rename' case, check whether source directory has set the sticky bit.

lisp/ChangeLog
lisp/net/tramp-sh.el

index ce0afc89d12caaaf47a455afcbf8200a1a0d3d67..e3a9a669e482658f63b08e44607118ed86eec81a 100644 (file)
@@ -7,6 +7,8 @@
        `remote-file-name-inhibit-cache' to nil in the second pass.
        (tramp-find-executable): Do not call "which" on SunOS.
        (tramp-send-command-and-check): Fix docstring.
+       (tramp-do-copy-or-rename-file-directly): In the `rename' case,
+       check whether source directory has set the sticky bit.
 
 2014-03-24  Barry O'Reilly  <gundaetiapo@gmail.com>
 
index 9cc913724fdb94607037a6fdc00414326e2816e5..22ea77147438f6ad12f6daa872454e7f700d0bc3 100644 (file)
@@ -2110,6 +2110,12 @@ the uid and gid from FILENAME."
           ;; We can do it directly.
           ((let (file-name-handler-alist)
              (and (file-readable-p localname1)
+                  ;; No sticky bit when renaming.
+                  (or (eq op 'copy)
+                      (zerop
+                       (logand
+                        (file-modes (file-name-directory localname1))
+                        (tramp-compat-octal-to-decimal "1000"))))
                   (file-writable-p (file-name-directory localname2))
                   (or (file-directory-p localname2)
                       (file-writable-p localname2))))