Get the ACL for a given path
#include <sys/acl.h> acl_t acl_get_file( const char *path_p, acl_type_t type );
- The path that you want to get the ACL for.
- The type of ACL; this must currently be ACL_TYPE_ACCESS.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The acl_get_file() function gets the ACL associated with the given file or directory, copies it into working storage, and returns a pointer to that storage. When you're finished with the ACL, you should call acl_free() to release it.
The ACL in working storage is independent of the file or directory's ACL. Changes that you make to the copy in working storage don't affect the file or directory's ACL.
A pointer to the ACL in working storage, or NULL if an error occurred ( errno is set).
- Search permission was denied for a component of the path prefix, or the object exists and the process doesn't have the appropriate access rights.
- The type argument isn't ACL_TYPE_ACCESS.
- The length of the path_p argument exceeds PATH_MAX.
- The named object doesn't exist, or path_p is an empty string.
- There wasn't enough memory available to create the ACL in working storage.
- A component of the path prefix isn't a directory.
This function is based on the withdrawn POSIX draft P1003.1e.
Last modified: 2014-06-24