From fcacca02dd945f1fce8ccfedae14e08b887d9adb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 5 Jul 2011 09:59:34 +0000 Subject: * 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. --- winsup/cygwin/path.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index d3e5bb6db..003c25c0e 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1673,11 +1673,15 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, goto done; } } - else if (!isdevice && win32_newpath.has_acls ()) + else if (!isdevice && win32_newpath.has_acls () && !win32_newpath.isremote ()) /* If the filesystem supports ACLs, we will overwrite the DACL after the call to NtCreateFile. This requires a handle with READ_CONTROL and WRITE_DAC access, otherwise get_file_sd and set_file_sd both have to - open the file again. */ + 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 |= READ_CONTROL | WRITE_DAC; status = NtCreateFile (&fh, access, win32_newpath.get_object_attr (attr, sa), -- cgit v1.2.3