summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/syscalls.cc11
2 files changed, 11 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index eb3b8de98..4d450fd2b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-25 Corinna Vinschen <corinna@vinschen.de>
+
+ * syscalls.cc (rename): Open file with FILE_READ_ATTRIBUTES.
+
2010-08-24 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h: Fix comment.
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index f13273c9f..2d0cdc36c 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -2010,10 +2010,13 @@ rename (const char *oldpath, const char *newpath)
start_transaction (old_trans, trans);
retry:
- /* DELETE is required to rename a file. Samba (only some versions?) doesn't
- like the FILE_SHARE_DELETE mode if the file has the R/O attribute set
- and returns STATUS_ACCESS_DENIED in that case. */
- status = NtOpenFile (&fh, DELETE, oldpc.get_object_attr (attr, sec_none_nih),
+ /* DELETE is required to rename a file. At least one cifs FS (Tru64) needs
+ FILE_READ_ATTRIBUTE, otherwise the FileRenameInformation call fails with
+ STATUS_ACCESS_DENIED. Samba (only some versions?) doesn't like the
+ FILE_SHARE_DELETE mode if the file has the R/O attribute set and returns
+ STATUS_ACCESS_DENIED in that case. */
+ status = NtOpenFile (&fh, DELETE | FILE_READ_ATTRIBUTES,
+ oldpc.get_object_attr (attr, sec_none_nih),
&io,
oldpc.fs_is_samba () ? FILE_SHARE_READ | FILE_SHARE_WRITE
: FILE_SHARE_VALID_FLAGS,