man Pages(3): Library Routines
  Search only this book
View this book in:
Download this book in PDF (5201 KB)

aclsort(3)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO

NAME

    aclsort- sort an ACL

SYNOPSIS

    #include <sys/acl.h>

    int aclsort(int nentries, int calclass, aclent_t *aclbufp);

DESCRIPTION

    aclbufp points to a buffer containing ACL entries. nentries specifies the number of ACL entries in the buffer. calclass, if non-zero, indicates that the CLASS_OBJ (ACL mask) permissions should be recalculated. The union of the permission bits associated with all ACL entries in the buffer other than CLASS_OBJ, OTHER_OBJ, and USER_OBJ is calculated. The result is copied to the permission bits associated with the CLASS_OBJ entry.

    aclsort() sorts the contents of the ACL buffer as follows:

    • Entries will be in the order USER_OBJ, USER, GROUP_OBJ, GROUP, CLASS_OBJ (ACL mask), OTHER_OBJ, DEF_USER_OBJ, DEF_USER, DEF_GROUP_OBJ, DEF_GROUP, DEF_CLASS_OBJ (default ACL mask), and DEF_OTHER_OBJ.

    • Entries of type USER, GROUP, DEF_USER, and DEF_GROUP will be sorted in increasing order by id.

    aclsort() will succeed if all of the following are true:

    • There is exactly one entry each of type USER_OBJ, GROUP_OBJ, CLASS_OBJ (ACL mask), and OTHER_OBJ.

    • There is exactly one entry each of type DEF_USER_OBJ, DEF_GROUP_OBJ, DEF_CLASS_OBJ (default ACL mask), and DEF_OTHER_OBJ if there are any default entries.

    • Entries of type USER, GROUP, DEF_USER, or DEF_GROUP may not contain duplicate entries. A duplicate entry is one of the same type containing the same numeric id.

RETURN VALUES

    Upon successful completion, the return value is 0. Otherwise, the return value is -1.

ATTRIBUTES

    See attributes(5) for descriptions of the following attributes:

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    Interface Stability 

    Evolving 

SEE ALSO

SunOS 5.7  Last Revised 30 Jul1998

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO