[OpenAFS] OpenAFS on MacOS X

Garance A Drosihn drosih@rpi.edu
Tue, 10 Jul 2001 18:47:23 -0400


At 4:27 PM -0400 7/10/01, Patrick J. LoPresti wrote:
>Derek Atkins <warlord@MIT.EDU> writes:
>  > The problem is that then you could not trust the information you get
>>  back from stat().  The owner, unix permissions, etc. are all stored
>>  in the volume itself and not in the mountpoint.  You can't easily
>>  change _that_, because volumes can be mounted in multiple places.
>>  It would violate the security semantics if a volume took the
>>  permissions of its parent.
>
>As someone else pointed out, sometimes the only interesting
>information about the mount point is that it is a directory.  Of
>course, I would only want this as an option (per-mountpoint would
>be ideal), not as the default.  Someone suggested this for root.afs;
>I am suggesting it could be useful elsewhere.
>
>You could get really fancy and have the stat() return "correct"
>information if the data were readily available (say, already in the
>cache?) but return "faked" information otherwise.  Or return one thing
>for stat("foo") and something else for chdir("foo");stat(".").  OK,
>maybe not :-).  But having the permissions shown by stat() be wrong,
>or even having them change randomly, is a small price to pay for
>letting Windows and Mac users browse around in an environment with
>dodgy connectivity, IMHO.

I think it would be very very bad to break stat().  It is a routine
with a well-defined meaning, and you have no idea if the caller of
stat "is only interested" in whether the given file is a directory.
Some callers want to be able to trust that all the information is
always correct, or, if not, that the caller will get an error return.

If you want to do something like this, then provide a new routine
which does nothing but indicate if a given pathname is a directory,
and then change anything which only wants to know "if something is
a directory" to use that new routine.

(the new routine could be another "xxstat()" routine, which returns
information in the same struct-format as stat, but which will only
guarantee to fill in some of the fields, or will give an alternate
error return if only some of the fields are correctly filled in).

-- 
Garance Alistair Drosehn            =   gad@eclipse.acs.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu