acl_from_text(3)

acl_from_text3

Create an acl from text

Usage

#include <sys/types.h>

#include <sys/acl.h>

acl_t

acl_from_text(const char *buf_p);

Library

Standard C Library (libc, -lc)

Overview

The acl_from_text() function converts the text form of an ACL referred to by buf_p into the internal working structure for ACLs, appropriate for applying to files or manipulating.

This function may cause memory to be allocated. The caller should free any releasable memory, when the new ACL is no longer required, by calling acl_free(3) with the (void *)acl_t as an argument.

Implementation notes

FreeBSD's support for POSIX.1e interfaces and features is still under development at this time.

Return values

Upon successful completion, the function shall return a pointer to the internal representation of the ACL in working storage. Otherwise, a value of (acl_t)NULL shall be returned, and errno shall be set to indicate the error.

Errors

If any of the following conditions occur, the acl_from_text() function shall return a value of (acl_t)NULL and set errno to the corresponding value:

[EINVAL]

Argument buf_p cannot be translated into an ACL.

[ENOMEM]

The ACL working storage requires more memory than is allowed by the hardware or system-imposed memory management constraints.

Releases

70 releases since FreeBSD 4.0-RELEASE; the text changed 38 times.

  1. 4.0
  2. 4.1–4.2
  3. 4.3–4.4
  4. 4.5–4.11
  5. 5.0
  6. 5.1–5.2.1
  7. 5.3–6.3
  8. 6.4
  9. 7.0
  10. 7.1
  11. 7.2
  12. 7.3
  13. 7.4
  14. 8.0
  15. 8.1
  16. 8.2
  17. 8.3
  18. 8.4
  19. 9.0
  20. 9.1
  21. 9.2
  22. 9.3
  23. 10.0
  24. 10.1
  25. 10.2
  26. 10.3
  27. 10.4
  28. 11.0
  29. 11.1
  30. 11.2
  31. 11.3
  32. 11.4
  33. 12.0
  34. 12.1
  35. 12.2
  36. 12.3
  37. 12.4
  38. 13.0–13.2
  39. 13.3–16.0

Standards

POSIX.1e is described in IEEE POSIX.1e draft 17. Discussion of the draft continues on the cross-platform POSIX.1e implementation mailing list. To join this list, see the FreeBSD POSIX.1e implementation page for more information.

History

POSIX.1e support was introduced in FreeBSD 4.0, and development continues.

Authors

Robert N M Watson

Bugs

The acl_from_text() and acl_to_text() functions rely on the getpwent(3) library calls to manage username and uid mapping, as well as the getgrent(3) library calls to manage groupname and gid mapping. These calls are not thread safe, and so transitively, neither are acl_from_text() and acl_to_text(). These functions may also interfere with stateful calls associated with the getpwent() and getgrent() calls.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.