Discussion:
[Bug-tar] ACL entries contain comments which may break compatibility
Michał Górny
2018-11-24 18:36:22 UTC
Permalink
Hi,

Thanks for fixing the previous bug I reported. Sadly, I just managed to
accidentally find another one. When ACL mask restricts effective ACL
entries, getfacl(1) reports the effective permissions as a comment,
e.g.:

user:nobody:rw- #effective:r--

It seems that GNU tar writes that comment as part of the pax header,
and e.g. libarchive does not restore the ACL correctly.

To reproduce:

touch input.txt
setfacl -m nobody:rw input.txt
setfacl -m m:r input.txt
tar --format=pax --acls -cf test.tar input.txt

The resulting pax attributes contain:

95 SCHILY.acl.access=user::rw-
user:nobody:rw- #effective:r--
group::r--
mask::r--
other::r--

Now extract e.g. with bsdtar (from libarchive):

$ bsdtar -xf test.tar --acls

And the u:nobody ACL is gone.
--
Best regards,
Michał Górny
Sergey Poznyakoff
2018-11-24 20:18:03 UTC
Permalink
I just managed to accidentally find another one.
Thanks a lot. Commit 62c0c3a7 fixes this.

Regards,
Sergey
Joerg Schilling
2018-11-26 11:44:41 UTC
Permalink
Post by Michał Górny
Hi,
Thanks for fixing the previous bug I reported. Sadly, I just managed to
accidentally find another one. When ACL mask restricts effective ACL
entries, getfacl(1) reports the effective permissions as a comment,
user:nobody:rw- #effective:r--
It seems that GNU tar writes that comment as part of the pax header,
and e.g. libarchive does not restore the ACL correctly.
Interesting, before I thought this code has been created by "looking at" the
original implementation from "star", but I did not understand why GNU tar
incorrectly leaves default ACLs on files that have been archived without ACLs.

Now it is obvious that the code has been written without looking at the
original implementation....

Jörg
--
EMail:***@schily.net (home) Jörg Schilling D-13353 Berlin
***@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'
Loading...