HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
a
acl(2) acl(2)
NAME
acl() - set a file’s Access Control List (ACL) information; JFS File Systems only
SYNOPSIS
#include <sys/types.h>
#include <aclv.h>
int acl(char *pathp, int cmd, int nentries, struct acl *aclbufp);
DESCRIPTION
The acl() system call is used to manipulate ACLs on JFS file system objects.
pathp points to a path name naming a file.
nentries specifies how many ACL entries are pointed to by aclbufp.
aclbufp is a pointer to the first element of an array of
struct acl. This type is defined in
<sys/acl.h> as follows:
struct acl {
int a_type; /* entry type */
uid_t a_id; /* user or group ID */
ushort a_perm; /* entry permissions */
};
The values for a_type are:
USER_OBJ Permissions for the owner of the object.
USER Permissions for additional users.
GROUP_OBJ Permissions for members of the owning group of the object.
GROUP Permissions for members of additional groups.
CLASS_OBJ Maximum permissions granted to the file group class.
OTHER_OBJ Permissions for other users.
DEF_USER_OBJ
Default permissions for the object owner.
DEF_USER Default permissions for additional users.
DEF_GROUP_OBJ
Default permissions for members of the owning group of the object.
DEF_GROUP Default permissions for members of additional groups
DEF_CLASS_OBJ
Default maximum permissions granted to the file group class.
DEF_OTHER_OBJ
Default permissions for other users.
cmd The following values for cmd are available:
ACL_SET
nentries ACL entries, specified in buffer aclbufp, are stored in the file’s ACL. Any
existing ACL on the file is replaced by the new ACL. All directories in the path name
must be searchable.
ACL_GET
Buffer aclbufp is filled with the file’s ACL entries. Discretionary read access to the file
is not required, but all directories in the path name must be searchable.
ACL_CNT
The number of entries in the file’s ACL is returned. Discretionary read access to the
file is not required, but all directories in the path name must be searchable.
For command ACL_SET, the acl() call will succeed if and only if all of the following are true:
• There is exactly one entry each of type USER_OBJ, GROUP_OBJ, CLASS_OBJ , and OTHER_OBJ.
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 35