Subject: Re: an in-kernel getcwd() implementation
To: None <firstname.lastname@example.org>
From: Bill Sommerfeld <email@example.com>
Date: 03/08/1999 11:35:13
> Does it fix it so that you can call getcwd() if somewhere in the directory
> structure above you there is a directory which you have execute but not
> read permission for? (You cannot with a non-kernel getcwd() but IMHO you
> should be able to.)
Actually, what it's doing right now is broken with respect to
permissions... The current implementation doesn't call VOP_ACCESS at
*all*, which is just wrong.
However, I don't think your proposed change (ignore read access
entirely) is correct, either.
When you miss in the cache, it calls VOP_READDIR, which requires read
access to the directory. For some filesystems (e.g., NFS/AFS/Coda),
the right to read may be enforced by a server in a different
protection domain, and thus we have no way to force it to get the
information if we don't have it cached already.
Rather than making the cache behavior visible to userspace (which will
look like spurious random lossage), I'm going to add a VOP_ACCESS
check to test for both read and execute access to the directories
along the path.