[Patch]: fs_info::update

Pierre A. Humblet pierre@phumblet.no-ip.org
Fri Jan 28 02:56:00 GMT 2005


When a user has no read access to the root of a drive, GetVolumeInformation
fails and has_acls is left unset. Consequently ntsec is off on that drive.
If a user "chmod -r" the root of a drive, ntsec is turned off and "chmod +r"
has no effect.
The patch does its best to set has_acls even in case of failure.

2005-01-28  Pierre Humblet <pierre.humblet@ieee.org>

	* path.cc (fs_info::update) Set has_acls even in case of failure.


Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.340
diff -u -p -r1.340 path.cc
--- path.cc     26 Jan 2005 04:34:19 -0000      1.340
+++ path.cc     28 Jan 2005 02:48:54 -0000
@@ -381,6 +381,8 @@ fs_info::update (const char *win32_path)
       debug_printf ("Cannot get volume information (%s), %E", root_dir);
       has_buggy_open (false);
       has_ea (false);
+      has_acls (GetLastError () == ERROR_ACCESS_DENIED
+                && (allow_smbntsec || !is_remote_drive ()));
       flags () = serial () = 0;
       return false;
     }



More information about the Cygwin-patches mailing list