Set the access control list for a path
#include <sys/acl.h> int acl_set_file( const char *path_p, acl_type_t type, acl_t acl );
- The path that you want to set the ACL for.
- The type of ACL; this must currently be ACL_TYPE_ACCESS.
- The ACL that you want to assign to the object.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The acl_set_file() function sets the access control list for a given path. The calling process's effective user ID must match the owner of the directory, or the process must have appropriate privileges in order to set the ACL. The ACL must also be valid, as defined by acl_valid().
If this function succeeds, the object's file permission bits might change; if it fails, the object's ACL and file permission bits aren't changed.
0, or -1 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 acl argument doesn't point to a valid ACL, or 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.
- The directory or filesystem that would contain the new ACL can't be extended, or the filesystem is out of file allocation resources.
- A component of the path prefix isn't a directory.
- The process doesn't have the appropriate privileges to set the ACL.
- The filesystem that the object is on is currently read-only.
This function is based on the withdrawn POSIX draft P1003.1e.
Last modified: 2013-09-30