Public bug reported:

The tar info page and upstream documentation indicate that when --xattr
is used "all names are stored in the archive (or extracted, if using '--
extract')", however when using --xattr with extract the
security.capability extended attributes are not restored. If one also
uses "--xattrs-include=*" then the security.capability extended
attributes will be restored.

[Test Case]
mkdir orig restore
touch orig/file_with_capability_and_user_xattr
setcap cap_net_raw=p orig/file_with_capability_and_user_xattr
(eoan-amd64)root@impulse:/tmp# getfattr -m . -d 
orig/file_with_capability_and_user_xattr
# file: orig/file_with_capability_and_user_xattr
security.capability=0sAAAAAgAgAAAAAAAAAAAAAAAAAAA=
user.testkey="testvalue"
(eoan-amd64)root@impulse:/tmp# tar c --xattrs --acls --directory orig/ . | tar 
x --xattrs --acls --directory restore/
(eoan-amd64)root@impulse:/tmp# getfattr -m . -d 
restore/file_with_capability_and_user_xattr
# file: restore/file_with_capability_and_user_xattr
user.testkey="testvalue"
(eoan-amd64)root@impulse:/tmp# tar c --xattrs --directory orig/ . | tar x 
--xattrs --xattrs-include=* --directory restore/
(eoan-amd64)root@impulse:/tmp# getfattr -m . -d 
restore/file_with_capability_and_user_xattr
# file: restore/file_with_capability_and_user_xattr
security.capability=0sAAAAAgAgAAAAAAAAAAAAAAAAAAA=
user.testkey="testvalue"

I think tar's extract behavior should be changed to match that of create
so that all names are actually extracted.

** Affects: tar (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: tar (Debian)
     Importance: Unknown
         Status: Unknown


** Tags: eoan

** Bug watch added: Debian Bug tracker #927261
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927261

** Also affects: tar (Debian) via
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927261
   Importance: Unknown
       Status: Unknown

** Tags added: eoan

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1831150

Title:
  security.capability extended attributes not restored upon extraction

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tar/+bug/1831150/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to