diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce0afc89d12..e3a9a669e48 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9cc913724fd..22ea7714743 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -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))))