| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- get or set a file's Access Control List (ACL)
#include <sys/acl.h>intacl(char *pathp,intcmd,intnentries,void *aclbufp);
intfacl(intfildes,intcmd,intnentries,void *aclbufp);
Theacl() andfacl() functions get or set the ACL ofa file whose name is given bypathp or referenced by theopen file descriptorfildes. Thenentries argument specifies how many ACL entries fitinto bufferaclbufp. Theacl() function is used to manipulate ACL onfile system objects.
The following types are supported foraclbufp:
Used by the UFS file system.
Used by the ZFS and NFSv4 file systems.
The following values forcmd are supported:
nentriesaclent_t ACL entries, specified in bufferaclbufp, are stored in the file's ACL. All directories in the path name must be searchable.
Bufferaclbufp is filled with the file'saclent_t ACL entries. Read access to the file is not required, but all directories in the path name must be searchable.
The number of entries in the file'saclent_t ACL is returned. Read access to the file is not required, but all directories in the path name must be searchable.
nentriesace_t ACL entries, specified in bufferaclbufp, are stored in the file's ACL. All directories in the path name must be searchable. Write ACL access is required to change the file's ACL.
Bufferaclbufp is filled with the file'sace_t ACL entries. Read access to the file is required and all directories in the path name must be searchable.
The number of entries in the file'sace_t ACL is returned. Read access to the file is required and all directories in the path name must be searchable.
Upon successful completion,acl() andfacl() return0 ifcmd isSETACL orACE_SETACL. Ifcmd isGETACL,GETACLCNT,ACE_GETACL orACE_GETACLCNT,the number of ACL entries is returned. Otherwise,-1 is returnedanderrno is set to indicate the error.
Theacl() function will fail if:
The caller does not have access to a component of the pathname.
Thepathp oraclbufp argument points to an illegal address.
Thecmd argument is notGETACL,SETACL,ACE_GETACL,GETACLCNT, orACE_GETACLCNT; thecmd argument isSETACL andnentries is less than 3; or thecmd argument isSETACL orACE_SETACL and the ACL specified inaclbufp is not valid.
A disk I/O error has occurred while storing or retrieving the ACL.
A component of the path does not exist.
Thecmd argument isGETACL andnentries is less than the number of entries in the file's ACL, or thecmd argument isSETACL and there is insufficient space in the file system to store the ACL.
Thecmd argument isSETACL orACE_SETACL and the file specified bypathp resides on a file system that does not support ACLs, or theacl() function is not supported by this implementation.
A component of the path specified bypathp is not a directory, or thecmd argument isSETACL orACE_SETACL and an attempt is made to set a default ACL on a file type other than a directory.
Thecmd argument isGETACL, but the ACL is composed oface_t entries, and the ACL cannot be translated intoaclent_t form.
Thecmd argument isACE_SETACL, but the underlying filesystem only supports ACLs composed ofaclent_t entries and the ACL could not be translated intoaclent_t form.
The effective user ID does not match the owner of the file and the process does not have appropriate privilege.
Thecmd argument isSETACL orACE_SETACL and the file specified bypathp resides on a file system that is mounted read-only.
Seeattributes(5) for descriptions of the following attributes:
|
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |