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 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.
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.
This function is based on the withdrawn POSIX draft P1003.1e.