[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

vn_access Entry Point

Purpose

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

Syntax

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

Parameters

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 vn_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 vn_access entry point. The v-node count is unchanged by this entry point.

In addition, the vn_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 vn_access entry point must ensure that write access is not requested on a read-only file system.

Execution Environment

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

Return Values

0 Indicates success.

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

EACCESS Indicates no access is allowed.

Related Information

The access subroutine.

Virtual File System Overview, Virtual File System Kernel Extensions Overview, Logical File System Overview, Understanding Virtual Nodes (V-nodes) in AIX Kernel Extensions and Device Support Programming Concepts.

List of Virtual File System Operations.


[ Previous | Next | Contents | Home | Search ]