Lines Matching refs:vsecattr

133 	vsecattr_t	vsecattr;
138 bzero(&vsecattr, sizeof (vsecattr_t));
146 vsecattr.vsa_mask = VSA_ACLCNT | VSA_DFACLCNT;
149 vsecattr.vsa_mask = VSA_ACECNT;
151 if (error = VOP_GETSECATTR(vp, &vsecattr, 0, CRED(), NULL))
153 *rv = vsecattr.vsa_aclcnt + vsecattr.vsa_dfaclcnt;
154 if (vsecattr.vsa_aclcnt && vsecattr.vsa_aclentp) {
155 kmem_free(vsecattr.vsa_aclentp,
156 vsecattr.vsa_aclcnt * entry_size);
158 if (vsecattr.vsa_dfaclcnt && vsecattr.vsa_dfaclentp) {
159 kmem_free(vsecattr.vsa_dfaclentp,
160 vsecattr.vsa_dfaclcnt * entry_size);
175 vsecattr.vsa_mask = VSA_ACL | VSA_ACLCNT | VSA_DFACL |
177 if (error = VOP_GETSECATTR(vp, &vsecattr, 0, CRED(), NULL))
180 numacls = vsecattr.vsa_aclcnt + vsecattr.vsa_dfaclcnt;
181 aclbsize = vsecattr.vsa_aclcnt * sizeof (aclent_t);
182 dfaclbsize = vsecattr.vsa_dfaclcnt * sizeof (aclent_t);
188 if (vsecattr.vsa_aclcnt > 1)
189 ksort((caddr_t)vsecattr.vsa_aclentp,
190 vsecattr.vsa_aclcnt, sizeof (aclent_t), cmp2acls);
191 if (vsecattr.vsa_dfaclcnt > 1)
192 ksort((caddr_t)vsecattr.vsa_dfaclentp,
193 vsecattr.vsa_dfaclcnt, sizeof (aclent_t), cmp2acls);
197 if (copyout(vsecattr.vsa_aclentp, uaddrp, aclbsize)) {
205 if (copyout(vsecattr.vsa_dfaclentp,
212 if (vsecattr.vsa_aclcnt) {
213 kmem_free(vsecattr.vsa_aclentp,
214 vsecattr.vsa_aclcnt * sizeof (aclent_t));
216 if (vsecattr.vsa_dfaclcnt) {
217 kmem_free(vsecattr.vsa_dfaclentp,
218 vsecattr.vsa_dfaclcnt * sizeof (aclent_t));
226 vsecattr.vsa_mask = VSA_ACE | VSA_ACECNT;
227 if (error = VOP_GETSECATTR(vp, &vsecattr, 0, CRED(), NULL))
230 aclbsize = vsecattr.vsa_aclcnt * sizeof (ace_t);
231 if (vsecattr.vsa_aclcnt > nentries) {
237 if ((error = copyout(vsecattr.vsa_aclentp,
243 *rv = vsecattr.vsa_aclcnt;
244 if (vsecattr.vsa_aclcnt) {
245 kmem_free(vsecattr.vsa_aclentp, vsecattr.vsa_aclentsz);
264 vsecattr.vsa_mask = VSA_ACL;
266 vsecattr.vsa_aclentp = kmem_alloc(aclbsize, KM_SLEEP);
267 aaclp = vsecattr.vsa_aclentp;
268 vsecattr.vsa_aclcnt = nentries;
270 if (copyin(uaddrp, vsecattr.vsa_aclentp, aclbsize)) {
275 ksort((caddr_t)vsecattr.vsa_aclentp,
276 vsecattr.vsa_aclcnt, sizeof (aclent_t), cmp2acls);
279 for (numacls = 0, aclp = vsecattr.vsa_aclentp;
280 numacls < vsecattr.vsa_aclcnt;
287 if (numacls < vsecattr.vsa_aclcnt) {
288 vsecattr.vsa_mask |= VSA_DFACL;
289 vsecattr.vsa_dfaclcnt = nentries - numacls;
290 vsecattr.vsa_dfaclentp = aclp;
291 vsecattr.vsa_aclcnt = numacls;
294 if (vsecattr.vsa_aclcnt == 0) {
295 vsecattr.vsa_mask &= ~VSA_ACL;
296 vsecattr.vsa_aclentp = NULL;
299 if (vsecattr.vsa_dfaclcnt && vp->v_type != VDIR) {
304 if (error = VOP_SETSECATTR(vp, &vsecattr, 0, CRED(), NULL)) {
326 vsecattr.vsa_mask = VSA_ACE;
328 vsecattr.vsa_aclentp = kmem_alloc(aclbsize, KM_SLEEP);
329 aaclp = vsecattr.vsa_aclentp;
330 vsecattr.vsa_aclcnt = nentries;
331 vsecattr.vsa_aclentsz = aclbsize;
333 if (copyin(uaddrp, vsecattr.vsa_aclentp, aclbsize)) {
338 if (error = VOP_SETSECATTR(vp, &vsecattr, 0, CRED(), NULL)) {
355 if (aclbsize && vsecattr.vsa_aclentp)
356 kmem_free(vsecattr.vsa_aclentp, aclbsize);
357 if (dfaclbsize && vsecattr.vsa_dfaclentp)
358 kmem_free(vsecattr.vsa_dfaclentp, dfaclbsize);