1 '\" te
   2 .\" Copyright (c) 2001, Sun Microsystems, Inc.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH ACLTOTEXT 3SEC "Dec 10, 2001"
   7 .SH NAME
   8 acltotext, aclfromtext \- convert internal representation to or from external
   9 representation
  10 .SH SYNOPSIS
  11 .nf
  12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ]
  13 #include <sys/acl.h>
  14 
  15 \fBchar *\fR\fBacltotext\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fIaclcnt\fR);
  16 .fi
  17 
  18 .LP
  19 .nf
  20 \fBaclent_t *\fR\fBaclfromtext\fR(\fBchar *\fR\fIacltextp\fR, \fBint *\fR\fIaclcnt\fR);
  21 .fi
  22 
  23 .SH DESCRIPTION
  24 The \fBacltotext()\fR function converts an internal \fBACL\fR representation
  25 pointed to by \fIaclbufp\fR into an external \fBACL\fR representation. The
  26 space for the external text string is obtained using \fBmalloc\fR(3C). The
  27 caller is responsible for freeing the space upon completion.
  28 .sp
  29 .LP
  30 The \fBaclfromtext()\fR function converts an external \fBACL\fR representation
  31 pointed to by \fIacltextp\fR into an internal \fBACL\fR representation.  The
  32 space for the list of \fBACL\fR entries is obtained using \fBmalloc\fR(3C). The
  33 caller is responsible for freeing the space upon completion. The \fIaclcnt\fR
  34 argument indicates the number of \fBACL\fR entries found.
  35 .sp
  36 .LP
  37 An external \fBACL\fR representation is defined as follows:
  38 .sp
  39 .LP
  40 <acl_entry>[,<acl_entry>]\|.\|.\|.
  41 .sp
  42 .LP
  43 Each <acl_entry> contains one \fBACL\fR entry. The external representation of
  44 an \fBACL\fR entry contains two or three colon-separated fields. The first
  45 field contains the \fBACL\fR entry tag type. The entry type keywords are
  46 defined as:
  47 .sp
  48 .ne 2
  49 .na
  50 \fB\fBuser\fR\fR
  51 .ad
  52 .RS 17n
  53 This \fBACL\fR entry with no \fBUID\fR specified in the \fBACL\fR entry
  54 \fBID\fR field specifies the access granted to the owner of the object.
  55 Otherwise, this \fBACL\fR entry specifies the access granted to a specific
  56 user-name or user-id number.
  57 .RE
  58 
  59 .sp
  60 .ne 2
  61 .na
  62 \fB\fBgroup\fR\fR
  63 .ad
  64 .RS 17n
  65 This \fBACL\fR entry with no \fBGID\fR specified in the \fBACL\fR entry
  66 \fBID\fR field specifies the access granted to the owning group of the object.
  67 Otherwise, this \fBACL\fR entry specifies the access granted to a specific
  68 group-name or group-id number.
  69 .RE
  70 
  71 .sp
  72 .ne 2
  73 .na
  74 \fB\fBother\fR\fR
  75 .ad
  76 .RS 17n
  77 This \fBACL\fR entry specifies the access granted to any user or group that
  78 does not match any other \fBACL\fR entry.
  79 .RE
  80 
  81 .sp
  82 .ne 2
  83 .na
  84 \fB\fBmask\fR\fR
  85 .ad
  86 .RS 17n
  87 This \fBACL\fR entry specifies the maximum access granted to user or group
  88 entries.
  89 .RE
  90 
  91 .sp
  92 .ne 2
  93 .na
  94 \fB\fBdefault:user\fR\fR
  95 .ad
  96 .RS 17n
  97 This \fBACL\fR entry with no uid specified in the \fBACL\fR entry \fBID\fR
  98 field specifies the default access granted to the owner of the object.
  99 Otherwise, this \fBACL\fR entry specifies the default access granted to a
 100 specific user-name or user-\fBID\fR number.
 101 .RE
 102 
 103 .sp
 104 .ne 2
 105 .na
 106 \fB\fBdefault:group\fR\fR
 107 .ad
 108 .RS 17n
 109 This \fBACL\fR entry with no gid specified in the \fBACL\fR entry \fBID\fR
 110 field specifies the default access granted to the owning group of the object.
 111 Otherwise, this \fBACL\fR entry specifies the default access granted to a
 112 specific group-name or group-\fBID\fR number.
 113 .RE
 114 
 115 .sp
 116 .ne 2
 117 .na
 118 \fB\fBdefault:other\fR\fR
 119 .ad
 120 .RS 17n
 121 This \fBACL\fR entry specifies the default access for other entry.
 122 .RE
 123 
 124 .sp
 125 .ne 2
 126 .na
 127 \fB\fBdefault:mask\fR\fR
 128 .ad
 129 .RS 17n
 130 This \fBACL\fR entry specifies the default access for mask entry.
 131 .RE
 132 
 133 .sp
 134 .LP
 135 The second field contains the \fBACL\fR entry \fBID\fR, as follows:
 136 .sp
 137 .ne 2
 138 .na
 139 \fB\fBuid\fR\fR
 140 .ad
 141 .RS 9n
 142 This field specifies a user-name, or user-\fBID\fR if there is no user-name
 143 associated with the user-\fBID\fR number.
 144 .RE
 145 
 146 .sp
 147 .ne 2
 148 .na
 149 \fB\fBgid\fR\fR
 150 .ad
 151 .RS 9n
 152 This field specifies a group-name, or group-\fBID\fR if there is no group-name
 153 associated with the group-\fBID\fR number.
 154 .RE
 155 
 156 .sp
 157 .ne 2
 158 .na
 159 \fB\fBempty\fR\fR
 160 .ad
 161 .RS 9n
 162 This field is used by the user and group \fBACL\fR entry types.
 163 .RE
 164 
 165 .sp
 166 .LP
 167 The third field contains the following symbolic discretionary access
 168 permissions:
 169 .sp
 170 .ne 2
 171 .na
 172 \fB\fBr\fR\fR
 173 .ad
 174 .RS 9n
 175 read permission
 176 .RE
 177 
 178 .sp
 179 .ne 2
 180 .na
 181 \fB\fBw\fR\fR
 182 .ad
 183 .RS 9n
 184 write permission
 185 .RE
 186 
 187 .sp
 188 .ne 2
 189 .na
 190 \fB\fBx\fR\fR
 191 .ad
 192 .RS 9n
 193 execute/search permission
 194 .RE
 195 
 196 .sp
 197 .ne 2
 198 .na
 199 \fB\fB\(mi\fR \fR
 200 .ad
 201 .RS 9n
 202 no access
 203 .RE
 204 
 205 .SH RETURN VALUES
 206 Upon successful completion, the \fBacltotext()\fR function returns a pointer to
 207 a text string. Otherwise, it returns \fBNULL\fR.
 208 .sp
 209 .LP
 210 Upon successful completion, the \fBaclfromtext()\fR function returns a pointer
 211 to a list of \fBACL\fR entries. Otherwise, it returns \fBNULL\fR.
 212 .SH ATTRIBUTES
 213 See \fBattributes\fR(5) for descriptions of the following attributes:
 214 .sp
 215 
 216 .sp
 217 .TS
 218 box;
 219 c | c
 220 l | l .
 221 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 222 _
 223 Interface Stability     Evolving
 224 _
 225 MT-Level        Unsafe
 226 .TE
 227 
 228 .SH SEE ALSO
 229 \fBacl\fR(2), \fBmalloc\fR(3C), \fBattributes\fR(5)