* Given a vnode, delete its ACL. */
| 295 | * Given a vnode, delete its ACL. |
| 296 | */ |
| 297 | static int |
| 298 | vacl_delete(struct thread *td, struct vnode *vp, acl_type_t type) |
| 299 | { |
| 300 | struct mount *mp; |
| 301 | int error; |
| 302 | |
| 303 | AUDIT_ARG_VALUE(type); |
| 304 | error = vn_start_write(vp, &mp, V_WAIT | PCATCH); |
| 305 | if (error != 0) |
| 306 | return (error); |
| 307 | vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); |
| 308 | AUDIT_ARG_VNODE1(vp); |
| 309 | #ifdef MAC |
| 310 | error = mac_vnode_check_deleteacl(td->td_ucred, vp, type); |
| 311 | if (error != 0) |
| 312 | goto out; |
| 313 | #endif |
| 314 | error = VOP_SETACL(vp, acl_type_unold(type), 0, td->td_ucred, td); |
| 315 | #ifdef MAC |
| 316 | out: |
| 317 | #endif |
| 318 | VOP_UNLOCK(vp); |
| 319 | vn_finished_write(mp); |
| 320 | return (error); |
| 321 | } |
| 322 | |
| 323 | /* |
| 324 | * Given a vnode, check whether an ACL is appropriate for it |
no test coverage detected