Bug 286669 - getfacl: sort order of permissions different from other systems
Summary: getfacl: sort order of permissions different from other systems
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 14.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Kyle Evans
URL: https://reviews.freebsd.org/D50260
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-08 11:42 UTC by Thorsten Mühlfelder
Modified: 2025-05-08 19:33 UTC (History)
2 users (show)

See Also:


Attachments
git(1) diff against libc (692 bytes, patch)
2025-05-08 18:04 UTC, Kyle Evans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Mühlfelder 2025-05-08 11:42:47 UTC
Hi,

while writing a script to set NFSv4 ACL on ZFS file systems I've noticed that getfacl shows the permissions bits in in different order than other systems.

On FreeBSD the full_set is: "rwxpDdaARWcCos"
On illumos and Synology Diskstation Linux the full_set is: "rwxpdDaARWcCos"

Note the "dD" vs. "Dd".

Just for reference:
* delete (d)             Permission to delete a file.
* delete_child (D)       Permission to delete a file within a directory.

I've stumbled upon this minor oddity while trying to set the FreeBSD style ACE on illumos, which fails:
 # chmod A+group:staff:rwxpDdaARWc--s:fd:allow /mnt/acltest
 Invalid permission(s) 'rwxpDdaARWc--s' specified

This one works:
 # chmod A+group:staff:rwxpdDaARWc--s:fd:allow /mnt/acltest

So why not use the same style?
Comment 1 Kyle Evans freebsd_committer freebsd_triage 2025-05-08 18:04:36 UTC
Created attachment 260267 [details]
git(1) diff against libc

Looking at this a bit, I guess the attached patch against libc would be sufficient.  I can't see anything that really 'does' positional bits in FreeBSD that would break, so I don't think there's much downside.