This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
fstat weirdness
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: cygwin-developers at cygwin dot com
- Date: Tue, 03 Jun 2003 11:43:30 -0400
- Subject: fstat weirdness
Around line 182 of fhandler-disk_file.cc there is this strange
comment:
/* 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.
Pierre