/bin/ls -V returns invalid names for acl on zfs filesystem
create a group with a long name:
- echo "LongNamedGroup1234567890123456789::999999:" >>/etc/group
- chmod A+ "group:LongNamedGroup1234567890123456789:rwxAWCos:fd:allow" somezfsdir
The cause seems to be the underlying API functions acltotext() and acl_totext(). Both functions silently shorten the given name to 31 characters. Tis may result in either a non-existing name, or worse, the name of another user/group.
A workaround can be to wrap any use of these functions by some logic that also extracts the uid/gid, does a reverse mapping of the id, and replaces the name.
A proof of concept for this workaround is attached. The program acllist list all the acls with their correct names.