Project

General

Profile

Bug #6313

/bin/ls -V returns invalid names for acl on zfs filesystem

Added by Arie Bikker about 4 years ago. Updated about 4 years ago.

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

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:
  1. echo "LongNamedGroup1234567890123456789::999999:" >>/etc/group
  2. chmod A+ "group:LongNamedGroup1234567890123456789:rwxAWCos:fd:allow" somezfsdir
  3. ls ldV somezfsfilesystem
    .....
    group:LongNamedGroup12345:rwx----A-W-Cos:fd----
    :allow
    ....

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

acllist.c (1.74 KB) acllist.c Arie Bikker, 2015-10-08 09:55 PM

Related issues

Is duplicate of illumos gate - Bug #4692: ls -V: The group name is truncatedNew2014-03-20

Actions

History

#1

Updated by Arie Bikker about 4 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
.....

#2

Updated by Marcel Telka about 4 years ago

  • Is duplicate of Bug #4692: ls -V: The group name is truncated added
#3

Updated by Marcel Telka about 4 years ago

This is a duplicate of Bug #4692.

#4

Updated by Marcel Telka about 4 years ago

  • Status changed from New to Closed

Also available in: Atom PDF