vnop_access Entry Point

Purpose

Requests validation of user access to a virtual node (v-node).

Syntax

int vnop_access ( vp,  mode,  who,  crp)
struct vnode *vp;
int mode;
int who;
struct ucred *crp;

Parameters

Item Description
vp Points to the v-node.
mode Identifies the access mode.
who Specifies the IDs for which to check access. This parameter should be one of the following values, which are defined in the /usr/include/sys/access.h file:
ACC_SELF
Determines if access is permitted for the current process. The effective user and group IDs and the supplementary group ID of the current process are used for the calculation.
ACC_ANY
Determines if the specified access is permitted for any user, including the object owner. The mode parameter must contain only one of the valid modes.
ACC_OTHERS
Determines if the specified access is permitted for any user, excluding the owner. The mode parameter must contain only one of the valid modes.
ACC_ALL
Determines if the specified access is permitted for all users. (This is a useful check to make when files are to be written blindly across networks.) The mode parameter must contain only one of the valid modes.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vnop_access entry point is used by the logical volume file system to validate access to a v-node. This entry point is used to implement the access subroutine. The v-node is held for the duration of the vnop_access entry point. The v-node count is unchanged by this entry point.

In addition, the vnop_access entry point is used for permissions checks from within the file system implementation. The valid types of access are listed in the /usr/include/sys/access.h file. Current modes are read, write, execute, and existence check.

Note: The vnop_access entry point must ensure that write access is not requested on a read-only file system.

Execution Environment

The vnop_access entry point can be called from the process environment only.

Return Values

Item Description
0 Indicates success.

Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure. A typical value includes:

Item Description
EACCES Indicates no access is allowed.