[OpenAFS-devel] kuserok() checking UID ownership on afs

Jeffrey Hutzelman jhutz@cmu.edu
Wed, 02 Feb 2005 11:41:33 -0500


On Wednesday, February 02, 2005 08:14:05 AM -0600 "Douglas E. Engert" 
<deengert@anl.gov> wrote:


> Would you accept any changes in this area to check if the file
> is in AFS, and not check the ownership?
> like if (strncmp(path,"/afs",4) ...

Besides being ugly, that test doesn't look very safe, either.
It matches /afsfoo
It matches /afs/foo.bar.edu/user/joe/.k5login which is a symlink to a
file in /usr/tmp owned by some other user.
It fails to deal when AFS is not mounted.
It fails to deal when AFS is mounted elsewhere.
It assumes semantics for the name "/afs" which may not apply everywhere.

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA