Function

vnode_authattr

Given a vnode_attr structure, determine what kauth-style actions must be authorized in order to set those attributes.

Declaration

int vnode_authattr(vnode_t vp, struct vnode_attr *vap, kauth_action_t *actionp, vfs_context_t ctx);

Parameters

vp

The vnode on which to authorize action.

vap

Pointer to vnode_attr struct containing desired attributes to set and their values.

actionp

Destination for set of actions to authorize

ctx

Context for which to authorize actions.

Return Value

0 (and a result in "actionp" for success. Otherwise, an error code.

Discussion

vnode_authorize requires kauth-style actions; if we want to set a vnode_attr structure on a vnode, we need to translate the set of attributes to a set of kauth-style actions. This routine will return errors for certain obviously disallowed, or incoherent, actions.