Sets the access control information of a file.
#include <sys/access.h>
int acl_set (Path, OwnerMode, GroupMode, DefaultMode) char *Path; int OwnerMode; int GroupMode; int DefaultMode;
int acl_fset (FileDescriptor, OwnerMode, GroupMode, DefaultMode) int *FileDescriptor; int OwnerMode; int GroupMode; int DefaultMode;
The acl_set and acl_fset subroutines set the base entries of the Access Control List (ACL) of the file. All other entries are discarded. Other access control attributes are left unchanged.
The mode parameters specify the access permissions in a bit mask containing zero or more of the following values:
R_ACC | Authorize read permission. |
W_ACC | Authorize write permission. |
X_ACC | Authorize execute or search permission. |
Upon successful completion, the acl_set and acl_fset subroutines return the value 0. Otherwise, the value -1 is returned and the errno global variable is set to indicate the error.
The acl_set subroutine fails and the access control information for a file remains unchanged if one or more of the following are true:
The acl_fset subroutine fails and the file permissions remain unchanged if the following is true:
EBADF | The file descriptor FileDescriptor is not valid. |
The acl_set or acl_fset subroutine fails and the access control information for a file remains unchanged if one or more of the following are true:
If Network File System (NFS) is installed on your system, the acl_set and acl_fset subroutines can also fail if the following is true:
ETIMEDOUT | The connection timed out. |
Access Control: The invoker must have search permission for all components of the Path prefix.
Event | Information |
---|---|
chacl | Path |
fchacl | FileDescriptor |
These subroutines are part of Base Operating System (BOS) Runtime.
The acl_chg subroutine, acl_get subroutine, acl_put subroutine, chacl subroutine, chmod subroutine, stat subroutine, statacl subroutine.
The aclget command, aclput command, chmod command.
List of Security and Auditing Subroutines and Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.