I need to write a program, part of which involves checking if the userid of the person executing the program exists in the ACL file of a file which the program uses. That is, this program writes into the file and only users whose ID and privileges are entered in the ACL are allowed to do so. How can the program check this? I know that I need to use the getresid function to get the RUID of the executing process, but how do I check this value against all the values stored in the ACL? Please help me!
I need to write a program, part of which involves checking if the userid
Share
If I misunderstood the question I apologize, but hopefully you will find this helpful:
Exceprt from some acl documentation:
The following functions retrieve and manipulate ACL entries:
The following functions retrieve and manipulate fields in an ACL entry:
…
From acl_update.c:
I dont think u need to check the ACL of a specific file, but if I am wrong, here is some info to do so:
then to get a uid from the name (untested but should be close):
Some more resources:
acl/facl examples and reference
man acl
POSIX Access Control Lists
statacl