Gets the access control information of a file if the ACL associated is of the AIXC type.
Security Library (libc.a)
#include <sys/access.h>
char *acl_get (Path)
char * Path;
char *acl_fget (FileDescriptor)
int FileDescriptor;
The acl_get and acl_fget subroutines retrieve the access control information for a file system object. This information is returned in a buffer pointed to by the return value. The structure of the data in this buffer is unspecified. The value returned by these subroutines should be used only as an argument to the acl_put or acl_fput subroutines to copy or restore the access control information. Note that acl_get and acl_fget subroutines could fail if the ACL associated with the file system object is of a different type than AIXC. It is recommended that applications make use of aclx_get and aclx_fget subroutines to retrieve the ACL.
The buffer returned by the acl_get and acl_fget subroutines is in allocated memory. After usage, the caller should deallocate the buffer using the free subroutine.
Item | Description |
---|---|
Path | Specifies the path name of the file. |
FileDescriptor | Specifies the file descriptor of an open file. |
On successful completion, the acl_get and acl_fget subroutines return a pointer to the buffer containing the access control information. Otherwise, a null pointer is returned and the errno global variable is set to indicate the error.
The acl_get subroutine fails if one or more of the following are true:
Item | Description |
---|---|
EACCES | Search permission is denied on a component of the Path prefix. |
EFAULT | The Path parameter points to a location outside of the allocated address space of the process. |
ELOOP | Too many symbolic links were encountered in translating the Path parameter. |
ENAMETOOLONG | A component of the Path parameter exceeded 255 characters, or the entire Path parameter exceeded 1023 characters. |
ENOTDIR | A component of the Path prefix is not a directory. |
ENOENT | A component of the Path does not exist or the process has the disallow truncation attribute (see the ulimit subroutine). |
ENOENT | The Path parameter was null. |
ENOENT | A symbolic link was named, but the file to which it refers does not exist. |
ESTALE | The process' root or current directory is located in a virtual file system that has been unmounted. |
The acl_fget subroutine fails if the following is true:
Item | Description |
---|---|
EBADF | The FileDescriptor parameter is not a valid file descriptor. |
The acl_get or acl_fget subroutine fails if the following is true:
Item | Description |
---|---|
EIO | An I/O error occurred during the operation. |
If Network File System (NFS) is installed on your system, the acl_get and acl_fget subroutines can also fail if the following is true:
Item | Description |
---|---|
ETIMEDOUT | The connection timed out. |
Item | Description |
---|---|
Access Control | The invoker must have search permission for all components of the Path prefix. |
Audit Events | None. |