[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    aclcheck(3) manual page Table of Contents

Name

aclcheck - check the validity of an ACL

Synopsis

#include <sys/acl.h>

int aclcheck(aclent_t *aclbufp, int nentries, int *which);

Description

aclcheck() checks the validity of an ACL pointed to by aclbufp. nentries is the number of entries contained in the buffer. which returns the index of the first entry that is invalid.

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.

Return Values

If the ACL is valid, alcheck() will return 0. Otherwise errno is set to EINVAL and return code is set to one of the following.
GRP_ERROR
There is more than one (default) group_obj ACL entry.
USER_ERROR
There is more than one (default) user_obj ACL entry.
CLASS_ERROR
There is more than one (default) class_obj ACL entry.
OTHER_ERROR
There is more than one (default) other_obj ACL entry.
DUPLICATE_ERROR
Duplicate (default) entries of user or group.
ENTRY_ERROR
The entry type is invalid.
MISS_ERROR
Missing (default) group_obj, user_obj, class_obj, or other_obj entries. which returns -1 in this case.
MEM_ERROR
The system can’t allocate any memory. which returns -1 in this case.

See Also

acl(2) , aclsort(3)


Table of Contents