vfs_aclxcntl Entry Point

Purpose

Implements access-control-specific control operations for a file system.

Syntax

int vfs_aclxcntl (vfsp, vp, cmd, uiop, argsize, crp) 

struct vfs     *vfsp; 
struct vnode   *vp; 
int               cmd; 
struct uio     *uiop; 
size_t         *argsize; 
struct ucred   *crp; 

Description

The vfs_aclxcntl entry point is invoked to perform various ACL-specific control operations on the underlying physical file system. If a file system is implemented to support this interface, it needs to adhere to the various commands and arguments defined for the interface. A file system implementation can define cmd parameter values and corresponding control functions that are specific to the file system. The cmd parameter for these functions has values defined globally for all the physical file systems. These control operations can be issued with the ACL library interfaces.

Parameters

Item Description
vfsp Points to the file system for which the control operation is to be issued.
vp Points to the virtual node pointer to the file path of the file system for which the control operation is being requested.
cmd Specifies which control operation to perform. Has one of the following values:
ACLCNTL_GETACLXTYPES
Returns the various ACL types supported for the file system instance. This area is of the following structure type:
typedef struct   _acl_types_list_t  { 
        uint32_t   num_entries;  // in the buffer to follow 
        uint32_t   pad;          // reserved space 
        acl_type_t entries[MAX_ACL_TYPES];     
 // Array of ACL types 
} acl_types_list_t ; 
If the buffer space is not enough to accommodate ACL types supported by the physical file system, errno is set to ENOSPC and the necessary size of the buffer is returned in argsize.
ACLCNTL_GETACLXTYPEINFO
Returns the characteristics information related to an ACL type for the file system instance. This area is of the following structure type:
typedef struct      _acl_type_info_t  { 
        acl_type_t    acl_type;      
// ACL type for which info is needed  
        uint8_t    acl_type_info;    
// Start of ACL characteristics data  
} _acl_type_info_t ; 
acl_type_info is the start byte of the ACL-related characteristics information. ACL characteristics information depends on the ACL type. ACL characteristics for NFS4 ACL type have the following structure:
typedef struct      _nfs4_acl_type_info_t  { 
        uint32_t  version;       
// Version of this structure 
        uint32_t  acl_suport;    
// Support of Access control entry types. 
} nfs4_acl_type_info_t ; 
If the buffer space is not enough to accommodate the ACL types supported by the physical file system, errno is set to ENOSPC and the necessary size of the buffer is returned in argsize.
uiop Identifies data specific to the control operation. If the cmd parameter has a value of ACLCNTL_GETACLXTYPES, uiop points to a buffer area where the file system stores the supported ACL types. If the cmd parameter has a value of ACLCNTL_GETACLXTYPEINFO, uiop points to a buffer area where the file system stores the ACL characteristics information.
argsize Identifies the length of the data specified by the arg parameter. This buffer is used to return the necessary buffer size, in case the buffer size provided by the user is not enough.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Execution Environment

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

Return Values

Upon successful completion, the vfs_aclxcntl entry point returns 0. Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.

Item Description
EACCES The cmd parameter requires a privilege that the current process does not have.
EINVAL Indicates that the cmd parameter is not a supported control, or the arg parameter is not a valid argument for the command.
ENOSPC The input buffer was not sufficient for storing the requested information.