* Given a vnode, get its ACL. */
| 263 | * Given a vnode, get its ACL. |
| 264 | */ |
| 265 | static int |
| 266 | vacl_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 |
| 285 | out: |
| 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. |
no test coverage detected