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>2011-07-05 13:59:34 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-07-05 13:59:34 +0400
commitfcacca02dd945f1fce8ccfedae14e08b887d9adb (patch)
treecd6da580e778fae9a0e5a355ce404009fbced839 /winsup/cygwin/fhandler.cc
parent3dce4ce6530b1de78b2c782cccef2d76bf5e6700 (diff)
* fhandler.cc (fhandler_base::open): Don't open file with WRITE_DAC
access on remote filesystem. Explain why. * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for directories. * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets. * path.cc (symlink_worker): Ditto for symlinks.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index fc6679e90..d41a37347 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -613,11 +613,16 @@ fhandler_base::open (int flags, mode_t mode)
/* If mode has no write bits set, and ACLs are not used, we set
the DOS R/O attribute. */
file_attributes |= FILE_ATTRIBUTE_READONLY;
- else if (!exists () && has_acls ())
+ else if (!exists () && has_acls () && !isremote ())
/* If we are about to create the file and the filesystem supports
ACLs, we will overwrite the DACL after the call to NtCreateFile.
This requires a handle with additional WRITE_DAC access,
- otherwise set_file_sd has to open the file again. */
+ otherwise set_file_sd has to open the file again.
+ FIXME: On remote NTFS shares open sometimes fails because even
+ the creator of the file doesn't have the right to change the
+ DACL. I don't know what setting that is or howq to recognize
+ such a share, so for now we don't request WRITE_DAC on remote
+ drives. */
access |= WRITE_DAC;
/* The file attributes are needed for later use in, e.g. fchmod. */