[OpenAFS] AFS access rights determination

Derek Atkins warlord@MIT.EDU
Wed, 26 Jan 2005 14:43:47 -0500


Please CC the list on all replies to me...

Priyank Porwal <porwal@cs.unc.edu> writes:

>>Actually, the access() system call, when used in an AFS context,
>>*WILL* check the AFS ACL permissions.  This was fixed (in Linux at
>>least) before Linux 1.2 was released.  I know -- I supplied Linus with
>>the patches to fix it.
>>
> Thanks Derek,
>
> What mode values should I pass to access() system call to test for i,d, 
> l, k, a AFS permissions?
> Man pages of access() don't say anything and i checked unistd.h for 
> constants like I_OK (similar to R_OK) but they are not defined.

You cannot use access() to check for specific acl entries.  What
access() will do is tell you in a boolean answer whether the user can
Read, Write, or Execute the filename in question.

> Essentially, I am trying to find what permissins a user has (and needs) 
> on all ancestors of the object whenever R, W, or X access on that object 
> fails.

You cannot use access() to determine why it fails.

> - priyank

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available