HP-UX Reference (11i v2 03/08) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

a
acl(5) acl(5)
chacl ’(bill.%,-w-)’ myfile
The following sets the entry for user 12 in group 4 to allow read and write.
chacl ’(12.4,wr)’ myfile
The following sets the base ACL entry for the file’s owner to allow both read and execute, and sets write
and execute capabilities for ‘‘other’’ users (the ‘‘%.%’’ entry).
chacl ’(@.%, 5) (%.%, xwx)’ myfile
Long Form
Here is the same ACL as in an earlier example, printed in long form.
r-x jpc.adm
--- ajs.trux
r-- jpc.%
r-x %.bin
r-- %.%
ACL Patterns
The following command locates files whose ACLs contain an entry that allows read access and denies
write access to some user/group combination.
find / -acl ’*.*+r-w’ -print
The following matches entries for any user in group bin and for user tammy in any group, regardless of
the entries’ mode values. Matching optional ACL entries are deleted and mode values in matching base
ACL entries are set to zero:
chacl -d ’%.bin, tammy.*=*’ myfile
The following matches all entries, deleting optional entries and setting mode values of base ACL entries
to zero:
chacl -d ’(*.*,*)’ myfile
HEADERS
Header <sys/acl.h>
The <sys/acl.h> header file defines the following constants to govern the numbers of entries per ACL:
NACLENTRIES maximum number of entries per ACL, including base entries
NBASEENTRIES number of base entries
NOPTENTRIES number of optional entries
The ACL entry structure
structacl_entry is also defined, and includes the following members:
aclid_t uid; /* user ID */
aclid_t gid; /* group ID */
aclmode_t mode; /* see <unistd.h> */
The
<sys/acl.h> header also defines the types aclid_t and aclmode_t.
Non-specific user and group ID values:
ACL_NSUSER non-specific user ID
ACL_NSGROUP non-specific group ID
A special nentries value
ACL_DELOPT is used with setacl (2) to delete optional entries.
Header <sys/getaccess.h>
The
<sys/getaccess.h> header defines constants for use with getaccess (2).
Special parameter values for uid:
UID_EUID use effective user ID
UID_RUID use real user ID
UID_SUID use saved user ID
Special parameter values for ngroups:
NGROUPS_EGID process’s effective gid
Section 5−−10 Hewlett-Packard Company − 7 − HP-UX 11i Version 2: August 2003