Files
erofs-freebsd-out-tree/docs/pre12-batch-03.md
T
2026-08-18 09:20:44 +02:00

1.9 KiB

Pre12 Batch 03: POSIX ACL mode helper

Change

  • In src/xattr.c, erofs_acl_from_mode now obtains the owner, group, and other permissions with acl_posix1e_mode_to_perm.
  • The helper tags are ACL_USER_OBJ, ACL_GROUP_OBJ, and ACL_OTHER, matching the adjacent ae_tag assignments.
  • No other function lines, ACL entry ordering, acl_cnt, IDs, default ACL handling, fallback behavior, flags, errno behavior, or control flow changed.

Helper confirmation

  • The local FreeBSD header sys/sys/acl.h declares acl_posix1e_mode_to_perm(acl_tag_t tag, mode_t mode) for kernel consumers.
  • The local FreeBSD implementation in sys/kern/subr_acl_posix1e.c maps ACL_USER_OBJ from S_IRWXU, ACL_GROUP_OBJ from S_IRWXG, and ACL_OTHER from S_IRWXO, returning the corresponding POSIX ACL read, write, and execute permission bits.
  • src/xattr.c already includes <sys/acl.h>; no include change was needed.

Exhaustive equivalence

A temporary standalone C program reproduced the local FreeBSD helper logic and compared it with the three replaced expressions for every permission mode from 0000 through 0777:

equivalent=1536/1536 modes=512 tags=3 mismatches=0
temporary_cleanup=ok

This covers 512 modes for each of the three tags. The temporary source and executable were deleted and are not part of the repository.

Static validation

  • The erofs_acl_from_mode function is line-for-line unchanged except for the three ae_perm expressions.
  • The source diff changes only those three expressions; this document is the only added file.
  • git diff --check and git diff --cached --check completed without errors.
  • Before commit, both unstaged status and staged status contained only src/xattr.c and docs/pre12-batch-03.md under repo-pre-12.

Tests not run

Per the Batch 03 execution constraints, no project build, QEMU run, smoke test, or feature test was run.