Print this page
12288 getfacl and setfacl could stand improvement
   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 ACLCHECK 3SEC "Dec 10, 2001"
   7 .SH NAME
   8 aclcheck \- check the validity of an ACL
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ]
  13 #include <sys/acl.h>
  14 
  15 \fBint\fR \fBaclcheck\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBint *\fR\fIwhich\fR);
  16 .fi
  17 
  18 .SH DESCRIPTION
  19 .sp
  20 .LP
  21 The \fBaclcheck()\fR function checks the validity of an \fBACL\fR pointed to by
  22 \fIaclbufp.\fR The \fInentries\fR argument is the number of entries contained
  23 in the buffer. The \fIwhich\fR parameter returns the index of the first entry
  24 that is invalid.
  25 .sp
  26 .LP
  27 The function verifies that an \fBACL\fR pointed to by \fIaclbufp\fR is valid
  28 according to the following rules:
  29 .RS +4
  30 .TP
  31 .ie t \(bu
  32 .el o
  33 There must be exactly one \fBGROUP_OBJ\fR \fBACL\fR entry.
  34 .RE
  35 .RS +4
  36 .TP
  37 .ie t \(bu
  38 .el o
  39 There must be exactly one \fBUSER_OBJ\fR \fBACL\fR entry.
  40 .RE


 101 .el o
 102 If there are any \fBDEF_USER\fR entries, then the user \fBID\fR in each
 103 \fBDEF_USER\fR \fBACL\fR entry must be unique.
 104 .RE
 105 .RS +4
 106 .TP
 107 .ie t \(bu
 108 .el o
 109 If there are any \fBDEF_GROUP\fR or \fBDEF_USER\fR entries, then there must be
 110 exactly one \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask) entry.
 111 .RE
 112 .RE
 113 .RS +4
 114 .TP
 115 .ie t \(bu
 116 .el o
 117 If any of the above rules are violated, then the function fails with
 118 \fBerrno\fR set to  \fBEINVAL\fR.
 119 .RE
 120 .SH RETURN VALUES
 121 .sp
 122 .LP
 123 If the \fBACL\fR is valid, \fBalcheck()\fR will return \fB0\fR. Otherwise
 124 \fBerrno\fR is set to \fBEINVAL\fR and return code is set to one of the
 125 following:
 126 .sp
 127 .ne 2
 128 .na
 129 \fB\fBGRP_ERROR\fR\fR
 130 .ad
 131 .RS 19n
 132 There is more than one \fBGROUP_OBJ\fR or \fBDEF_GROUP_OBJ\fR \fBACL\fR entry.
 133 .RE
 134 
 135 .sp
 136 .ne 2
 137 .na
 138 \fB\fBUSER_ERROR\fR\fR
 139 .ad
 140 .RS 19n
 141 There is more than one \fBUSER_OBJ\fR or \fBDEF_USER_OBJ\fR \fBACL\fR entry.
 142 .RE
 143 
 144 .sp


 182 .sp
 183 .ne 2
 184 .na
 185 \fB\fBMISS_ERROR\fR\fR
 186 .ad
 187 .RS 19n
 188 Missing an entry. The \fIwhich\fR parameter returns \fB\(mi1\fR in this case.
 189 .RE
 190 
 191 .sp
 192 .ne 2
 193 .na
 194 \fB\fBMEM_ERROR\fR\fR
 195 .ad
 196 .RS 19n
 197 The system cannot allocate any memory. The \fBwhich\fR parameter returns
 198 \fB\(mi1\fR in this case.
 199 .RE
 200 
 201 .SH ATTRIBUTES
 202 .sp
 203 .LP
 204 See \fBattributes\fR(5) for descriptions of the following attributes:
 205 .sp
 206 
 207 .sp
 208 .TS
 209 box;
 210 c | c
 211 l | l .
 212 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 213 _
 214 Interface Stability     Evolving
 215 _
 216 MT-Level        Unsafe
 217 .TE
 218 
 219 .SH SEE ALSO
 220 .sp
 221 .LP
 222 \fBacl\fR(2), \fBaclsort\fR(3SEC), \fBattributes\fR(5)
   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 ACLCHECK 3SEC "Dec 10, 2001"
   7 .SH NAME
   8 aclcheck \- check the validity of an ACL
   9 .SH SYNOPSIS

  10 .nf
  11 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsec\fR [ \fIlibrary\fR... ]
  12 #include <sys/acl.h>
  13 
  14 \fBint\fR \fBaclcheck\fR(\fBaclent_t *\fR\fIaclbufp\fR, \fBint\fR \fInentries\fR, \fBint *\fR\fIwhich\fR);
  15 .fi
  16 
  17 .SH DESCRIPTION


  18 The \fBaclcheck()\fR function checks the validity of an \fBACL\fR pointed to by
  19 \fIaclbufp.\fR The \fInentries\fR argument is the number of entries contained
  20 in the buffer. The \fIwhich\fR parameter returns the index of the first entry
  21 that is invalid.
  22 .sp
  23 .LP
  24 The function verifies that an \fBACL\fR pointed to by \fIaclbufp\fR is valid
  25 according to the following rules:
  26 .RS +4
  27 .TP
  28 .ie t \(bu
  29 .el o
  30 There must be exactly one \fBGROUP_OBJ\fR \fBACL\fR entry.
  31 .RE
  32 .RS +4
  33 .TP
  34 .ie t \(bu
  35 .el o
  36 There must be exactly one \fBUSER_OBJ\fR \fBACL\fR entry.
  37 .RE


  98 .el o
  99 If there are any \fBDEF_USER\fR entries, then the user \fBID\fR in each
 100 \fBDEF_USER\fR \fBACL\fR entry must be unique.
 101 .RE
 102 .RS +4
 103 .TP
 104 .ie t \(bu
 105 .el o
 106 If there are any \fBDEF_GROUP\fR or \fBDEF_USER\fR entries, then there must be
 107 exactly one \fBDEF_CLASS_OBJ\fR (default \fBACL\fR mask) entry.
 108 .RE
 109 .RE
 110 .RS +4
 111 .TP
 112 .ie t \(bu
 113 .el o
 114 If any of the above rules are violated, then the function fails with
 115 \fBerrno\fR set to \fBEINVAL\fR.
 116 .RE
 117 .SH RETURN VALUES
 118 If the \fBACL\fR is valid, \fBaclcheck()\fR will return \fB0\fR. Otherwise
 119 \fBerrno\fR is set to \fBEINVAL\fR and \fBaclcheck()\fR will return one of the


 120 following:
 121 .sp
 122 .ne 2
 123 .na
 124 \fB\fBGRP_ERROR\fR\fR
 125 .ad
 126 .RS 19n
 127 There is more than one \fBGROUP_OBJ\fR or \fBDEF_GROUP_OBJ\fR \fBACL\fR entry.
 128 .RE
 129 
 130 .sp
 131 .ne 2
 132 .na
 133 \fB\fBUSER_ERROR\fR\fR
 134 .ad
 135 .RS 19n
 136 There is more than one \fBUSER_OBJ\fR or \fBDEF_USER_OBJ\fR \fBACL\fR entry.
 137 .RE
 138 
 139 .sp


 177 .sp
 178 .ne 2
 179 .na
 180 \fB\fBMISS_ERROR\fR\fR
 181 .ad
 182 .RS 19n
 183 Missing an entry. The \fIwhich\fR parameter returns \fB\(mi1\fR in this case.
 184 .RE
 185 
 186 .sp
 187 .ne 2
 188 .na
 189 \fB\fBMEM_ERROR\fR\fR
 190 .ad
 191 .RS 19n
 192 The system cannot allocate any memory. The \fBwhich\fR parameter returns
 193 \fB\(mi1\fR in this case.
 194 .RE
 195 
 196 .SH ATTRIBUTES


 197 See \fBattributes\fR(5) for descriptions of the following attributes:
 198 .sp
 199 
 200 .sp
 201 .TS
 202 box;
 203 c | c
 204 l | l .
 205 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 206 _
 207 Interface Stability     Evolving
 208 _
 209 MT-Level        Unsafe
 210 .TE
 211 
 212 .SH SEE ALSO


 213 \fBacl\fR(2), \fBaclsort\fR(3SEC), \fBattributes\fR(5)