acl_valid() — Validate an ACL

Standards

Standards / Extensions C or C++ Dependencies

z/OS UNIX

both z/OS V1R3

Format

#define _OPEN_SYS	1
#include <sys/acl.h>

int     acl_valid (lacl_t acl_d, acl_entry_t *entry_p);			

General description

Use access control lists (ACLs) in conjunction with permission bits to control access to files and directories. Currently, ACLs are supported by the HFS, TFS, and zFS file systems. You must know whether your security product supports ACLs and what rules are used when determining file access. See z/OS UNIX System Services Planning for details.

The acl_valid() function checks the access ACL, file default ACL, or directory default ACL referred to by the argument acl_d for validity.

The ACL_USER, ACL_GROUP, and ACL_OTHER can only exist once in base ACL entries. The ACL_OTHER only applies to base ACL entries.

The tag type (user, group) must contain valid values for the extended ACL entries. The qualifier field (uid, gid) must be unique among all extended ACL entries of the same ACL except for the extended ACL entries that are mapped for deletion (see ACL entry mapping in sys/acl.h for more information). The ordering of base and/or extended ACL entries within ACL referred by the acl_d may be changed.

The first call to acl_get_entry() following the call to acl_valid() obtains the first extended ACL entry in the ACL as ordered by the system.

Returned value

Upon successful completion, the function returns a value of zero.

If any of the following conditions occur, the location referred to by entry_p will be undefined and the acl_valid() function returns -1 and sets errno to the corresponding value:

Error Code
Description
EINVAL
Argument acl_d does not point to an ACL structure.

If any of the following conditions occur, the acl_valid() function will set the location referred to by entry_p to one of the ACL entries in error, return -2 and set errno to the appropriate value.

Error Code
Description
EINVAL
The ACL contains extended ACL entries that are not unique or is not a valid ACL entry type.

If any of the following conditions occur, the acl_valid() function will return -3 and set errno to the appropriate value.

Error Code
Description
EINVAL
The ACL contains base ACL entries that are not unique or is not a valid ACL entry type. Only one base ACL entry of the same tag type (ACL_USER, ACL_GROUP, ACL_OTHER) may exist.

Related information