From 22e671336e8db5fe4f026d1c0c8eb98b4e7d728f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 21 Oct 2011 17:43:00 +0000 Subject: [PATCH] * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Check invalid success only on Samba shares. * mount.cc (fs_info::update): Drop has_buggy_basic_info flag for NcFsd. * syscalls.cc (unlink_nt): Fix typo in comment. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/fhandler_disk_file.cc | 3 ++- winsup/cygwin/mount.cc | 4 ++-- winsup/cygwin/syscalls.cc | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 97dcccf72..e522fa494 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2011-10-21 Corinna Vinschen + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Check invalid + success only on Samba shares. + * mount.cc (fs_info::update): Drop has_buggy_basic_info flag for + NcFsd. + * syscalls.cc (unlink_nt): Fix typo in comment. + 2011-10-21 Corinna Vinschen * globals.cc (ro_u_ncfsd): New R/O unicode string. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index d07cc93fb..e1ed4e18f 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1727,7 +1727,8 @@ fhandler_disk_file::rmdir () &fbi); if (!NT_SUCCESS (status) && q_status == STATUS_OBJECT_NAME_NOT_FOUND) status = STATUS_SUCCESS; - else if (NT_SUCCESS (status) && NT_SUCCESS (q_status)) + else if (pc.fs_is_samba () + && NT_SUCCESS (status) && NT_SUCCESS (q_status)) status = STATUS_DIRECTORY_NOT_EMPTY; } if (!NT_SUCCESS (status)) diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index a9accfad9..b0fe6ee8b 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -379,14 +379,14 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) Know example: EMC NS-702. We just don't use that info class on any remote CIFS. */ has_buggy_fileid_dirinfo (is_cifs () || is_unixfs ()); - /* NWFS/NcFsd is known to have a broken FileBasicInformation info + /* NWFS is known to have a broken FileBasicInformation info class. It can't be used to fetch information, only to set information. Therefore, for NWFS we have to fallback to the FileNetworkOpenInformation info class. Unfortunately we can't use FileNetworkOpenInformation all the time since that fails on other filesystems like NFS. UNUSED, but keep in for information purposes. */ - has_buggy_basic_info (is_nwfs () || is_ncfsd ()); + has_buggy_basic_info (is_nwfs ()); /* Netapp and NWFS/NcFsd are too dumb to allow non-DOS filenames containing trailing dots and spaces when accessed from Windows clients. We subsume CIFS into this class of filesystems right diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index d4aab4db5..faaa42a34 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -645,7 +645,7 @@ unlink_nt (path_conv &pc) have to move it back. That's bad, because the directory would be moved around which results in a temporary inconsistent state. So, what we do here is to test if the directory is empty. If - not, we bail out with ERROR_DIR_NOT_EMTPY. The below code + not, we bail out with STATUS_DIRECTORY_NOT_EMPTY. The below code tests for at least three entries in the directory, ".", "..", and another one. Three entries means, not empty. This doesn't work for the root directory of a drive, but the root dir can