Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#775495: tar: please use the same options to backup and restore xattrs

33 views
Skip to first unread message

Ingo Wichmann (Linuxhotel)

unread,
Jan 16, 2015, 7:00:04 AM1/16/15
to
Package: tar
Version: 1.27.1-1~bpo70+1
Severity: normal
Tags: upstream

Dear Maintainer,

since version 1.27 tar honours ACLs and filesystem xattrs ( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=254615 )

You can backup files in a directory with the following command:

tar cf backup.tar --xattrs --acls --directory orig/ .

But to restore it, you need to add ''--xattrs-include='*' '', to restore all attributes:
tar xf backup.tar --xattrs --acls --xattrs-include='*' --directory restore/

In my opinion, that is not what a user would expect. It would be better, if the options to create the archive were the same as the options restoring the archive. See also #775489 ( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775489 )

A full example:

Create two directories and a file with acls and xattrs on a filesystem that supports them:

mkdir orig restore
touch orig/file_with_acl_capability_and_user_xattr
setcap cap_net_raw=p orig/file_with_acl_capability_and_user_xattr
setfattr -n user.testkey -v testvalue orig/file_with_acl_capability_and_user_xattr
setfacl -m u:nutzer23:rwx orig/file_with_acl_capability_and_user_xattr

Check whether xattrs and acls are there:

getfattr -m . -d orig/file_with_acl_capability_and_user_xattr
getfacl orig/file_with_acl_capability_and_user_xattr

Create a backup with tar:

tar c --xattrs --acls --directory orig/ . | tar x --xattrs --acls --directory restore/

Check whether xattrs and acls are still there:

getfacl restore/file_with_acl_capability_and_user_xattr
getfattr -m . -d restore/file_with_acl_capability_and_user_xattr

Here some extended attributes are missing. Workaround:

tar c --xattrs --acls --directory orig/ . | tar x --xattrs --acls --xattrs-include='*' --directory restore/

The authors of the acl and xattr patch were aware of this problem, but decided not to solve it:
https://bugzilla.redhat.com/show_bug.cgi?id=771927#c24



-- System Information:
Debian Release: 7.8
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tar depends on:
ii libacl1 2.2.51-8
ii libc6 2.13-38+deb7u6
ii libselinux1 2.1.9-5

tar recommends no packages.

Versions of packages tar suggests:
ii bzip2 1.0.6-4
pn ncompress <none>
pn tar-scripts <none>
ii xz-utils 5.1.1alpha+20120614-2

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Brian Murray

unread,
Jun 12, 2019, 2:50:03 PM6/12/19
to
I brought this same matter up with upstream and they've indicated that
the --xattrs-include defaults to "^user.*" due to cross platform
compatibility concerns[1].

[1] https://lists.gnu.org/archive/html/bug-tar/2019-06/msg00002.html

--
Brian Murray @ubuntu.com
signature.asc
0 new messages