Function

vnode_authattr_new

Initialize and validate file creation parameters with respect to the current context.

Declaration

int vnode_authattr_new(vnode_t dvp, struct vnode_attr *vap, int noauth, vfs_context_t ctx);

Parameters

dvp

The directory in which creation will occur.

vap

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

noauth

If 1, treat the caller as the superuser, i.e. do not check permissions.

ctx

Context for which to authorize actions.

Return Value

KAUTH_RESULT_ALLOW for success, an error to indicate invalid or disallowed attributes.

Discussion

vnode_authattr_new() will fill in unitialized values in the vnode_attr struct with defaults, and will validate the structure with respect to the current context for file creation.