#include <sys/acl.h>
int aclcheck(aclent_t *aclbufp, int nentries, int *which);
The function verifies that an ACL pointed to by aclbufp is valid according to the following rules:
There must be exactly one group_obj ACL entry.There must be exactly one user_obj ACL entry.
There must be exactly one other_obj ACL entry.
If there are any group ACL entries, then the group ID in each group ACL entry must be unique.
If there are any user ACL entries, then the user ID in each user ACL entry must be unique.
If there are any group or user ACL entries, then there must be exactly one class_obj ACL entry.
If there are any default ACL entries, then the following apply:
- There must be exactly one default group_obj ACL entry.
- There must be exactly one default other_obj ACL entry.
- There must be exactly one default user_obj ACL entry.
- If there are any default group entries, then the group ID
- in each default group ACL entry must be unique.
- If there are any default user entries, then the user ID
- in each default user ACL entry must be unique.
- If there are any default group or user entries,
- then there must be exactly one default class_obj ACL entry.
If any of the above rules are violated, then the function fails with errno set to EINVAL.