Symantec logo

vxfacl

NAME

vxfacl - set a VxFS file's Access Control List entries

SYNOPSIS

cc -I /opt/VRTSvxfs/include -L /opt/VRTSvxfs/lib
-l vxfsutil -ldl

#include <sys/types.h>

#include <aclv.h>

#include <vxfsutil.h>

int vxfacl(int fd, int cmd, int nentries, struct acl* aclbufp);

AVAILABILITY

VRTSvxfs

DESCRIPTION

The vxfacl() function uses the ioctl interface to manipulate ACLs Access Control Lists (ACL) on a VxFS file system. See the acl(2) manual page for information on ACLs.

The fields are:

fd

Open file descriptor of the file.

cmd

Command to perform. Possible values for cmd are:

ACL_SET

Stores nentries ACL entries that are specified in aclbufp in the file's ACL. Any existing ACL on the file is replaced by the new ACL. This command can only be executed by a process that has an effective user ID equal to the owner of the file, or by the superuser.

ACL_GET

Fills buffer aclbufp with the file's ACL entries. Read access to the file is not required.

See the acl(2) manual page for the semantics of ACL_SET and ACL_GET.

All directories in the pathname must be searchable for all of the cmd values.

nentries

Number of ACL entries to which buffer aclbufp points.

aclbufp

A pointer to the first element of an array of struct acl. The struct acl is defined in the aclv.h header file as follows:

struct acl {

int a_type; /* ACL entry type */

uid_t a_id; /* UID or GID */

ushort a_perm; /* entry permissions */

};

See the acl(2) manual page for more information on the a_type and a_perm members.

NOTES

vxfacl() is only supported on local HFS file systems on the standard HP-UX 11.23 operating system. No support for remote file systems is provided.

RETURN VALUES

Upon successful completion, vxfacl() returns the number of ACL entries for the ACL_GET command, and 0 for the ACL_SET command. On failure, vxfacl() returns -1 and sets errno to indicate the error.

ERRORS

EINVAL

cmd is not ACL_GET, or ACL_SET.

cmd

is ACL_SET and nentries is less than 4, which is the number of mandatory ACL entries.

EINVAL

cmd is ACL_SET and the ACL specified in aclbufp is not valid. See the DESCRIPTION section and the aclsort(3C) manual page for more information.

EIO

A disk I/O error has occurred while storing or retrieving the ACL.

EPERM

cmd is ACL_SET and the effective user ID of the caller does not match the owner of the file, and the caller is not the superuser.

ENOSPC

cmd is ACL_GET and nentries is less than the number of entries in the file's ACL,

ENOSPC

cmd is ACL_SET and there is insufficient space in aclbufp to store the ACL.

ENOSPC

cmd is ACL_SET and nentries is greater than NACLVENTRIES, which is defined in aclv.h.

ENOTDIR

A component of the path specified by pathname is not a directory, or an attempt was made to set a default ACL on a file type other than a directory.

ENOSYS

The file opened descriptor described by fd is of a file that resides on a local non-JFS file system.

EROFS

cmd is ACL_SET and the file specified by fd resides on a read-only file system.

EFAULT

The aclbufp argument points to an illegal address.

SEE ALSO

getacl(1), setacl(1), acl(2), aclsort(3)