Actions
Bug #6313
closed/bin/ls -V returns invalid names for acl on zfs filesystem
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2015-10-08
Due date:
% Done:
0%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
acls in form group:name:... return an invalid name if the name has a stringlength > 31. This is probably also true fo user:name entries
To reproduce:
create a group with a long name:
To reproduce:
create a group with a long name:
- echo "LongNamedGroup1234567890123456789::999999:" >>/etc/group
- chmod A+ "group:LongNamedGroup1234567890123456789:rwxAWCos:fd:allow" somezfsdir
- ls
ldV somezfsfilesystem:allow
.....
group:LongNamedGroup12345:rwx----A-W-Cos:fd----
....
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.
Files
Related issues
Updated by Arie Bikker almost 7 years ago
Sorry for the garbbled commands (first post ;)
should be
# echo "LongNamedGroup1234567890123456789::999999:" >>/etc/group # chmod A+ "group:LongNamedGroup1234567890123456789:rwxAWCos:fd:allow" somezfsdir # ls ldV somezfsfilesystem ..... group:LongNamedGroup12345:rwx----A-W-Cos:fd----:allow .....
Updated by Marcel Telka almost 7 years ago
- Is duplicate of Bug #4692: ls -V: The group name is truncated added
Actions