[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    acltotext(3) manual page Table of Contents

Name

acltotext, aclfromtext - convert an internal representation to/from external representation

Synopsis

#include <sys/acl.h>

char *acltotext(aclent_t *aclbufp, int aclcnt);

aclent_t *aclfromtext(char *acltextp, int *aclcnt);

Description

acltotext() converts an internal ACL representation pointed to by aclbufp into an external ACL representation. The space for the external text string is obtained using malloc(3C) . The caller is responsible for freeing the space when it’s done.

aclfromtext() converts an external ACL representation pointed to by acltextp into an internal ACL representation. The space for the list of ACL entries is obtained using malloc(3C) . The caller is responsible for freeing the space when it’s done. aclcnt is returned to indicate the number of acl entries found.

An external ACL representation is defined as follows:

<acl_entry>[,<acl_entry>]...

Each <acl_entry> contains one ACL entry. The external representation of an ACL entry contains three colon-separated fields. The first field contains the ACL entry tag type. The entry type keywords are defined as:

user
This ACL entry with no uid specified in the ACL entry id field specifies the access granted to the owner of the object. Otherwise, this ACL entry specifies the access granted to a specific user-name or user-id number.
group
This ACL entry with no gid specified in the ACL entry id field specifies the access granted to the owning group of the object. Otherwise, this ACL entry specifies the access granted to a specific group-name or group-id number.
other
This ACL entry specifies the access granted to any user or group that does not match any other ACL entry.
mask
This ACL entry specifies the maximum access granted to user or group entries.
defaultuser
This ACL entry with no uid specified in the ACL entry id field specifies the default access granted to the owner of the object. Otherwise, this ACL entry specifies the default access granted to a specific user-name or user-id number.
defaultgroup
This ACL entry with no gid specified in the ACL entry id field specifies the default access granted to the owning group of the object. Otherwise, this ACL entry specifies the default access granted to a specific group-name or group-id number.
defaultother
This ACL entry specifies the default access for other entry.
defaultmask
This ACL entry specifies the default access for mask entry.

The second field contains the ACL entry id. It is as follows:

uid
This field specifies a user-name, or user-id if there is no user-name associated with the user-id number.
gid
This field specifies a group-name, or group-id if there is no group-name associated with the group-id number.
empty
It is used by user, group, other, and mask ACL entry types.

The third field contains the following symbolic discretionary access permissions:

r
read permission
w
write permission
x
execute/search permission
-
no access

Return Values

Upon successful completion, the function returns a pointer to a text string ( acltotext() ) or to a list of ACL entries ( aclfromtext() ). Otherwise, it returns NULL.

See Also

acl(2) , malloc(3C)


Table of Contents