---
name: "acl_valid"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/acl_valid"
---

# acl\_valid(3)

validate an ACL

## NAME

**acl\_valid**, **acl\_valid\_fd\_np**, **acl\_valid\_file\_np**, **acl\_valid\_link\_np** – validate an ACL

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/acl.h\>**

*int*\

**acl\_valid**(*acl\_t acl*);

*int*\

**acl\_valid\_fd\_np**(*int fd*, *acl\_type\_t type*, *acl\_t acl*);

*int*\

**acl\_valid\_file\_np**(*const char \*path\_p*, *acl\_type\_t type*, *acl\_t acl*);

*int*\

**acl\_valid\_link\_np**(*const char \*path\_p*, *acl\_type\_t type*, *acl\_t acl*);

## DESCRIPTION

These functions check that the ACL referred to by the argument *acl* is valid.  The POSIX.1e routine, **acl\_valid**(), checks assumes ACL\_TYPE\_EXTENDED, and disregard of the context in which the ACL is to be used.  The non-portable forms, **acl\_valid\_fd\_np**(), **acl\_valid\_file\_np**(), and **acl\_valid\_link\_np**() allow an ACL to be checked in the context of a specific acl type, *type*, and file system object. In environments where additional ACL types are supported than just POSIX.1e, this makes more sense. Whereas **acl\_valid\_file\_np**() will follow the symlink if the specified path is to a symlink, **acl\_valid\_link\_np**() will not.

The qualifier field shall be unique among all entries of the same POSIX.1e ACL facility defined tag type.  The tag type field shall contain valid values including any implementation-defined values.  Validation of the values of the qualifier field is implementation-defined.

The POSIX.1e **acl\_valid**() function may reorder the ACL for the purposes of verification; the non-portable validation functions will not.

## RETURN VALUES

The **acl\_valid()** function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

## ERRORS

If any of the following conditions occur, these functions shall return -1 and set *errno* to the corresponding value:

- \[EACCES\]

  Search permission is denied for a component of the path prefix, or the object exists and the process does not have appropriate access rights.

- \[EBADF\]

  The *fd* argument is not a valid file descriptor.

- \[EINVAL\]

  Argument *acl* does not point to a valid ACL.

  One or more of the required ACL entries is not present in *acl*.

  The ACL contains entries that are not unique.

  The file system rejects the ACL based on fs-specific semantics issues.

- \[ENAMETOOLONG\]

  A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

- \[ENOENT\]

  The named object does not exist, or the *path\_p* argument points to an empty string.

- \[ENOMEM\]

  Insufficient memory available to fulfill request.

- \[EOPNOTSUPP\]

  The file system does not support ACL retrieval.

## SEE ALSO

[acl(3)](/acl/3.md), [acl\_get(3)](/acl_get/3.md), [acl\_init(3)](/acl_init/3.md), [acl\_set(3)](/acl_set/3.md), [posix1e(3)](/posix1e/3.md)

## STANDARDS

POSIX.1e is described in IEEE POSIX.1e draft 17.

## AUTHORS

Michael Smith Robert N M Watson
