aclsort(3C)


aclsort -- sort an Access Control List

Synopsis

   #include <sys/types.h>
   #include <acl.h>
   

int aclsort(int nentries, int calclass, struct acl *aclbufp);

Description

The aclsort routine sorts Access Control List (ACL) entries into the correct order to be accepted by the acl system call.

aclbufp points to a buffer containing ACL entries; calclass, if non-zero, indicates that the CLASS_OBJ permissions should be recalculated; and nentries specifies the number of ACL entries in the buffer.

aclsort sorts the contents of the ACL buffer as follows:

  1. Entries will be in order USER_OBJ, USER, GROUP_OBJ, GROUP, CLASS_OBJ, OTHER_OBJ, DEF_USER_OBJ, DEF_USER, DEF_GROUP_OBJ, DEF_GROUP, DEF_CLASS_OBJ, and DEF_OTHER_OBJ.

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

The aclsort call will succeed if all of the following are true:

Return values

Upon successful completion, the return value is 0. If there are duplicate entries, the return value is the position of the first duplicate entry. If there is more than one entry of type USER_OBJ, GROUP_OBJ, CLASS_OBJ, OTHER_OBJ, DEF_USER_OBJ, DEF_GROUP_OBJ, DEF_CLASS_OBJ or DEF_OTHER_OBJ, they are treated as duplicate entries, and the return value is the position of the first duplicate entry. For all other errors, the return value is -1.

References

acl(2)

Notices


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004