'\" te .\" Copyright (c) 2001, Sun Microsystems, Inc. .TH acltotext 3SEC "10 Dec 2001" "SunOS 5.11" "File Access Control Library Functions" .SH NAME acltotext, aclfromtext \- convert internal representation to or from external representation .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ] #include \fBchar *\fR\fBacltotext\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fIaclcnt\fR); .fi .LP .nf \fBaclent_t *\fR\fBaclfromtext\fR(\fBchar *\fR\fIacltextp\fR, \fBint *\fR\fIaclcnt\fR); .fi .SH DESCRIPTION .sp .LP The \fBacltotext()\fR function converts an internal \fBACL\fR representation pointed to by \fIaclbufp\fR into an external \fBACL\fR representation. The space for the external text string is obtained using \fBmalloc\fR(3C). The caller is responsible for freeing the space upon completion.. .sp .LP The \fBaclfromtext()\fR function converts an external \fBACL\fR representation pointed to by \fIacltextp\fR into an internal \fBACL\fR representation. The space for the list of \fBACL\fR entries is obtained using \fBmalloc\fR(3C). The caller is responsible for freeing the space upon completion. The \fIaclcnt\fR argument indicates the number of \fBACL\fR entries found. .sp .LP An external \fBACL\fR representation is defined as follows: .sp .LP [,]\|.\|.\|. .sp .LP Each contains one \fBACL\fR entry. The external representation of an \fBACL\fR entry contains two or three colon-separated fields. The first field contains the \fBACL\fR entry tag type. The entry type keywords are defined as: .sp .ne 2 .mk .na \fB\fBuser\fR\fR .ad .RS 17n .rt This \fBACL\fR entry with no \fBUID\fR specified in the \fBACL\fR entry \fBID\fR field specifies the access granted to the owner of the object. Otherwise, this \fBACL\fR entry specifies the access granted to a specific user-name or user-id number. .RE .sp .ne 2 .mk .na \fB\fBgroup\fR\fR .ad .RS 17n .rt This \fBACL\fR entry with no \fBGID\fR specified in the \fBACL\fR entry \fBID\fR field specifies the access granted to the owning group of the object. Otherwise, this \fBACL\fR entry specifies the access granted to a specific group-name or group-id number. .RE .sp .ne 2 .mk .na \fB\fBother\fR\fR .ad .RS 17n .rt This \fBACL\fR entry specifies the access granted to any user or group that does not match any other \fBACL\fR entry. .RE .sp .ne 2 .mk .na \fB\fBmask\fR\fR .ad .RS 17n .rt This \fBACL\fR entry specifies the maximum access granted to user or group entries. .RE .sp .ne 2 .mk .na \fB\fBdefault:user\fR\fR .ad .RS 17n .rt This \fBACL\fR entry with no uid specified in the \fBACL\fR entry \fBID\fR field specifies the default access granted to the owner of the object. Otherwise, this \fBACL\fR entry specifies the default access granted to a specific user-name or user-\fBID\fR number. .RE .sp .ne 2 .mk .na \fB\fBdefault:group\fR\fR .ad .RS 17n .rt This \fBACL\fR entry with no gid specified in the \fBACL\fR entry \fBID\fR field specifies the default access granted to the owning group of the object. Otherwise, this \fBACL\fR entry specifies the default access granted to a specific group-name or group-\fBID\fR number. .RE .sp .ne 2 .mk .na \fB\fBdefault:other\fR\fR .ad .RS 17n .rt This \fBACL\fR entry specifies the default access for other entry. .RE .sp .ne 2 .mk .na \fB\fBdefault:mask\fR\fR .ad .RS 17n .rt This \fBACL\fR entry specifies the default access for mask entry. .RE .sp .LP The second field contains the \fBACL\fR entry \fBID\fR, as follows: .sp .ne 2 .mk .na \fB\fBuid\fR\fR .ad .RS 9n .rt This field specifies a user-name, or user-\fBID\fR if there is no user-name associated with the user-\fBID\fR number. .RE .sp .ne 2 .mk .na \fB\fBgid\fR\fR .ad .RS 9n .rt This field specifies a group-name, or group-\fBID\fR if there is no group-name associated with the group-\fBID\fR number. .RE .sp .ne 2 .mk .na \fB\fBempty\fR\fR .ad .RS 9n .rt This field is used by the user and group \fBACL\fR entry types. .RE .sp .LP The third field contains the following symbolic discretionary access permissions: .sp .ne 2 .mk .na \fB\fBr\fR\fR .ad .RS 9n .rt read permission .RE .sp .ne 2 .mk .na \fB\fBw\fR\fR .ad .RS 9n .rt write permission .RE .sp .ne 2 .mk .na \fB\fBx\fR\fR .ad .RS 9n .rt execute/search permission .RE .sp .ne 2 .mk .na \fB\fB\(mi\fR \fR .ad .RS 9n .rt no access .RE .SH RETURN VALUES .sp .LP Upon successful completion, the \fBacltotext()\fR function returns a pointer to a text string. Otherwise, it returns \fBNULL\fR. .sp .LP Upon successful completion, the \fBaclfromtext()\fR function returns a pointer to a list of \fBACL\fR entries. Otherwise, it returns \fBNULL\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelUnsafe .TE .SH SEE ALSO .sp .LP \fBacl\fR(2), \fBmalloc\fR(3C), \fBattributes\fR(5)