Is there any way to query ACLs on Linux programmatically? Given a file or directory, I have to check if an ACL exists for it and then find开发者_运维技巧 out the level of access granted to different users. All I could find on the net were the getfacl
and setfacl
command line utilities which are of no use to me. Also, what are the best practices I need to follow when working with ACLs?
They are in the acl.h
header. There are links out to each of the functions from here.
A few sample functions:
- acl_create_entry - create a new ACL entry
- acl_delete_entry - delete an ACL entry
- acl_get_entry - get an ACL entry
The functions are in libacl.
精彩评论