bugGNU tar - Bugs: bug #61934, `numeric-owner` doesn't apply to...

 
 

bug #61934: `numeric-owner` doesn't apply to ACL entries

Submitter:  None
Submitted:  Wed 26 Jan 2022 02:31:59 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  gray
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 18 May 2023 10:39:43 AM UTC, comment #1: 
Sergey Poznyakoff <gray>
Group administrator
Wed 26 Jan 2022 02:31:59 PM UTC, original submission:  

ACL entries store references to numeric uids/gids. on platforms that have libacl, use `acl_to_any_text` to generate ACL strings that preserve those numeric identifiers if `numeric-owner` is set (instead of doing a conversion to user/group name, like the acl_to_text function does).

reproducer (similar ones exist where a user/group of the stored name exists, but has a different numeric identifier):

system A with user foo with uid 1001
system B with no user foo
file with ACL referencing uid 1001 on system A

on A:
$ echo 'bar' > file
$ setfacl -m u:foo:r file
$ tar --acls --xattrs --numeric-owner -cf test.tar file
$ tar -vv --acls --xattrs -tf test.tar

expected output:
-rw-r--r--+ 0/0         4 2022-01-26 14:32 file
  a: user::rw-,user:1001:r--,group::r--,mask::r--,other::r--

actual output:
-rw-r--r--+ 0/0         4 2022-01-26 14:32 file
  a: user::rw-,user:fakeuser:r--,group::r--,mask::r--,other::r--

on B:
$ tar --acls --xattrs -xf test.tar
$ getfacl -n file

expected output (extraction) - none
expected output (getfacl):
 # file: file
 # owner: 0
 # group: 0
 user::rw-
 user:1001:r--
 group::r--
 other::r--

actual output (extraction):
tar: file: Warning: Cannot acl_from_text: Invalid argument

actual output (getfacl) - note the missing user entry:
 # file: file
 # owner: 0
 # group: 0
 user::rw-
 group::r--
 other::r--


attached patch (on-top of current HEAD) changes the behaviour of archive creation to honor `numeric-owner` iff libacl is available. the extraction side remains unchanged (it handles both numeric and symbolic references in ACL entries).


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gray (Posted a comment)
  • -email is unavailable- added by fgruenbichler (bug opener)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-05-18 gray StatusNone Fixed
        Assigned toNone gray
        Open/ClosedOpen Closed
    2022-01-26 fgruenbichler Carbon-Copy- Added fgruenbichler
    2022-01-26 None Attached File- Added 0001-extend-numeric-owner-to-ACL-entries.patch, #52744

    Back to the top

    Powered by Savane 3.13-0159.
    Corresponding source code