This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
stat with no READ_CONTROL
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: cygwin-developers at cygwin dot com
- Date: Wed, 08 Jan 2003 23:15:16 -0500
- Subject: stat with no READ_CONTROL
Corinna,
when stat is called on a file with a non-readable security descriptor
(e.g. because of no READ_CONTROL permission), read_sd fails but stat
still succeeds.
However the uid and gid are set to garbage (uninitialized automatic
variables) and the modes are from nontsec, rw-r--r--.
Other info, such as the times and size, can be correct.
The question is what to do about it. According to posix
<http://www.opengroup.org/onlinepubs/007908799/xsh/fstat.html>
stat can (additional or alternative file access control mechanisms)
and must (cannot provide correct info) fail.
A consequence of this hard nosed approach is that ls -l may not show
all files. To avoid that, stat could return uid = gid = -1 and modes = 0.
Which is best in this case: conformance to posix or user friendliness?
Pierre