fstat weirdness

Pierre A. Humblet Pierre.Humblet@ieee.org
Tue Jun 3 15:41:00 GMT 2003

Around line 182 of fhandler-disk_file.cc there is this strange
  /* Check a special case here. If ntsec is ON it happens
     that a process creates a file using mode 000 to disallow
     other processes access. In contrast to UNIX, this results
     in a failing open call in the same process. Check that
     case. */
I have looked up cvs and the ChangeLogs to find its origin,
without success.

The comment is strange because this section runs after a query_open
has failed for access reasons. Such failure ONLY happens if there is
no access_allowed ACE (even without any rights) for the current user
nor one of his/her groups. Thus it can't happen when the file was
created by Cygwin (as implied in the comment), because Cygwin
always adds ACEs for the owner and for everyone (even with mode 000).

The only way I can get this code to be activated is by going out
of Cygwin to remove all ACEs, e.g. to provide opaqueness, and then 
doing an ls.
The current code then modifies the ACL and removes the opaqueness.

Is there a strong reason to do so? Otherwise I don't think it's desirable 
behavior for fstat to modify a file in any way, and I volunteer to patch
this code away.


More information about the Cygwin-developers mailing list