> [...]
>> Ok, I use ksh which hides the problem with its built-in pwd. But I can
>> recreate it if I run /bin/pwd. A truss reveals
>> 3172/1: open("./..", O_RDONLY|O_NDELAY|O_LARGEFILE) Err#13 EACCES
>> If I had to take a guess, ./.. is being mapped to the ./.. of the
>> underlying mount point, but the permissions of the underlying ./. are
>> preventing that from being accessed. Sounds like it would take only
>> a couple of lines of code (possibly repeated in one or two places) to
>> fix that one!
> For the Solaris 8 FCS code, the relevant source file appears to be
> src/uts/common/fs/lookup.c; that's about all I can say here...hopefully
> one of the Sun guys (Casper, where are you???) will take the hint, file
> a bug, and maybe even a fix.
The more I look at it, the more I wonder if the problem could be fixed (or
worked around) in lookup.c. Imagine doing a /bin/pwd somewhere below an
NFS mount on top of a subdirectory of another NFS mount (could certainly
exist on a diskless client). Now since root doesn't (without special
arrangements which a diskless client might well have had made for it) work
over NFS, a temporary fudging of credentials when looking up ".." in the
underlying filesystem wouldn't necessarily be good enough.
If filesystems "knew" which of their vnodes had something mounted on top
of them (and what it was), they could grant for ".." in those directories
the execute permissions of the directory mounted on top of them rather
than those of the underlying mount point. (sorry, I don't know how to
say some of this in a non-convoluted way) But that gets worse too,
since a server could have multiple clients mounting directories with
different permissions on top of the same mount point that they export.
Otherwise, a solution would be to allow whatever was needed for
stat() of any ".." to succeed, whether it was a redirection to the
one underlying a mount point or not. But that has broader scope than
necessary and doesn't honor the perms of the one on top, so presumably
it has security implications; I haven't thought through how serious they
are...
So depending on whether there's an easy and good way that I'm missing,
or whether something less precise than the obvious expectation might
be ok, it might take changes to each filesystem plus to the generic
code plus perhaps even to the interface between the two; and even then,
it may be not just a lot of work, but introduce all sorts of other
unacceptable problems. Yikes.
Still, I hope someone who can get somewhere with it (and is more
experienced with the internals than I am) would take a look at it.
IMO, the reasonable expectation is that while ".." in the root of
a mounted filesystem is redirected to the underlying "..", the permissions
of the one on top (as seen by that client system) should still apply.
I don't even want to think of where that all goes when you throw in the
enhanced lofs that's part of zone support...my head hurts, and my
coffee has worn off now.
--
Lasik/PRK theme music:
"In the Hall of the Mountain King", from "Peer Gynt"