Issue 329 in libarchive: ACLs are not preserved by bsdtar

39 views
Skip to first unread message

libar...@googlecode.com

unread,
Jul 27, 2013, 2:28:09 PM7/27/13
to libarchiv...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium OpSys-All

New issue 329 by ambr...@gmail.com: ACLs are not preserved by bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

What steps will reproduce the problem?

localhost ~ # touch a
localhost ~ # setfacl -m user:nobody:r a
localhost ~ # ls -l a
-rw-r--r--+ 1 root root 0 Jul 27 20:22 a
localhost ~ # mkdir extract
localhost ~ # bsdtar -cpf - a | bsdtar -xpf - -C extract/
localhost ~ # ls -l extract/
total 0
-rw-r--r-- 1 root root 0 Jul 27 20:22 a

What is the expected output? What do you see instead?

The ACL should be preserved, but it is not (no + in permissions).

What version are you using?

3.1.2

On what operating system?

Gentoo Linux ~amd64

How did you build?

Gentoo ebuild, uses configure.

What compiler or development environment?

gcc 4.7.3

Please provide any additional information below.

I distinctly remember bsdtar preserving ACLs some time ago. Libarchive is
definitely being compiled with ACLs enabled, as can be seen in the build
log.

Attachments:
out 88.2 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

libar...@googlecode.com

unread,
Aug 8, 2013, 10:45:26 AM8/8/13
to libarchiv...@googlegroups.com

Comment #1 on issue 329 by j.koncic...@gmail.com: ACLs are not preserved by
bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

I found out the cause of this bug and fixed it.

The problem is that ACL_TYPE_NFS4 is not defined in some systems in
sys/acl.h (I am using Fedora 19 3.10.4-300.fc19.x86_64 and it is not here).
This causes that functions translate_acl() in
archive_read_disk_entry_from_file.c:404 and archive_write_disk_set_acls()
in archive_write_disk_acl.c:69 are suppressed by #if defined() directive
and thus saving and restoring ACLs is not performed.

I fixed the problem by removing #ifdef ACL_TYPE_NFS4 suppressing the whole
functions and instead putting #ifdefs to all individual places where
NFS4-only code is. So now these functions are compiled even if you don't
have ACL_TYPE_NFS4 and only code that needs it is not compiled.

I already fixed it in Fedora 19:
https://bugzilla.redhat.com/show_bug.cgi?id=993048
Now it is on testing stage. If you find any problem please contact me.

Attachments:
libarchive-3.1.2-acl-fix.patch 7.0 KB

libar...@googlecode.com

unread,
Aug 19, 2013, 3:12:17 AM8/19/13
to libarchiv...@googlegroups.com

Comment #2 on issue 329 by j.koncic...@gmail.com: ACLs are not preserved by
bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

* bump
This bugfix was recently pushed to Fedora 19 stable repository:
https://bugzilla.redhat.com/show_bug.cgi?id=993048
Please give a feedback, you can actually use this patch to fix the bug
globally.

libar...@googlecode.com

unread,
Aug 19, 2013, 8:19:40 AM8/19/13
to libarchiv...@googlegroups.com

Comment #3 on issue 329 by ambr...@gmail.com: ACLs are not preserved by
bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

Thanks for the fix. I confirm the fix works on Gentoo (libarchive-3.1.2-r1).

libar...@googlecode.com

unread,
Oct 8, 2013, 5:44:33 AM10/8/13
to libarchiv...@googlegroups.com

Comment #4 on issue 329 by ambr...@gmail.com: ACLs are not preserved by
bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

Bump; will this ever be applied?

libar...@googlecode.com

unread,
Jan 1, 2014, 7:09:57 AM1/1/14
to libarchiv...@googlegroups.com

Comment #5 on issue 329 by andreas....@gmail.com: ACLs are not preserved by
bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

Doubtful if you'll get a reaction here, but the devs are responsive to pull
requests on github: https://github.com/libarchive/libarchive/pulls

libar...@googlecode.com

unread,
Jan 5, 2014, 12:48:32 AM1/5/14
to libarchiv...@googlegroups.com
Updates:
Status: Fixed

Comment #6 on issue 329 by kien...@gmail.com: ACLs are not preserved by
bsdtar
http://code.google.com/p/libarchive/issues/detail?id=329

I've committed the fix.

Thanks for your patience!
Reply all
Reply to author
Forward
0 new messages