This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]