MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vacl_get_acl

Function vacl_get_acl

freebsd/kern/vfs_acl.c:265–292  ·  view source on GitHub ↗

* Given a vnode, get its ACL. */

Source from the content-addressed store, hash-verified

263 * Given a vnode, get its ACL.
264 */
265static int
266vacl_get_acl(struct thread *td, struct vnode *vp, acl_type_t type,
267 struct acl *aclp)
268{
269 struct acl *inkernelacl;
270 int error;
271
272 AUDIT_ARG_VALUE(type);
273 inkernelacl = acl_alloc(M_WAITOK | M_ZERO);
274 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
275 AUDIT_ARG_VNODE1(vp);
276#ifdef MAC
277 error = mac_vnode_check_getacl(td->td_ucred, vp, type);
278 if (error != 0)
279 goto out;
280#endif
281 error = VOP_GETACL(vp, acl_type_unold(type), inkernelacl,
282 td->td_ucred, td);
283
284#ifdef MAC
285out:
286#endif
287 VOP_UNLOCK(vp);
288 if (error == 0)
289 error = acl_copyout(inkernelacl, aclp, type);
290 acl_free(inkernelacl);
291 return (error);
292}
293
294/*
295 * Given a vnode, delete its ACL.

Callers 2

kern___acl_get_pathFunction · 0.85
sys___acl_get_fdFunction · 0.85

Calls 6

vn_lockFunction · 0.85
mac_vnode_check_getaclFunction · 0.85
acl_type_unoldFunction · 0.85
acl_copyoutFunction · 0.85
acl_allocFunction · 0.70
acl_freeFunction · 0.70

Tested by

no test coverage detected