Create an access control list (ACL) from text


#include <sys/acl.h>

acl_t acl_from_text( const char *buf_p );


A pointer to a buffer that contains the text form of the ACL that you want to convert.



Use the -l c option to qcc to link against this library. This library is usually included automatically.


The acl_from_text() function converts an access control list from text form into the internal form of an ACL. This function accepts the long and short text forms of an ACL:


In the long form, tag_type is user, group, other, or mask, the qualifier is an empty string or the name or numeric ID of a user or group, and the permissions are in the form rwx, with a hyphen (-) replacing any permissions that aren't granted.

Entry type Tag type constant Form
Owner ACL_USER_OBJ user::permissions
Named user (identified by name or by numerical ID) ACL_USER user:user_identifier:permissions
Owning group ACL_GROUP_OBJ group::permissions
Named group (identified by name or numerical ID) ACL_GROUP group:group_identifier:permissions
The upper bound on permissions for the group class ACL_MASK mask::permissions
Others ACL_OTHER other::permissions

In the short form, you can abbreviate the tag_type to its first letter, and the permissions can contain at most one each of r, w, and x, in any order.

When you're finished with the resulting ACL, you should call acl_free() to release it.


A pointer to the internal representation of the ACL, or NULL if an error occurred (errno is set).


The contents of the buffer couldn't be converted into an ACL.
There wasn't enough memory available to allocate for the ACL in working storage.


QNX Neutrino

This function is based on the withdrawn POSIX draft P1003.1e.

Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes