Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-08-25 12:51:41 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-08-25 12:51:41 +0400
commitdf70da7f6c2cc9c8661cbd45ec39e4c29a9a92cf (patch)
treeac2bb275ef0ac411ce524bd4740651d1bb0bd203 /winsup/cygwin
parent58ae62fd9419c8ad4b8367aabde8b0aace235c74 (diff)
* syscalls.cc (rename): Open file with FILE_READ_ATTRIBUTES.
Diffstat (limited to 'winsup/cygwin')
-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,