Thursday 2 August 2018

Re: RFC: baseline requirements for Ubuntu rootfs: xattrs and fscaps

On Thu, Aug 02, 2018 at 01:22:07PM +0100, Colin Watson wrote:
> On Wed, Aug 01, 2018 at 05:58:56PM -0700, Steve Langasek wrote:
> > - Users who are unpacking root tarballs need to take care to pass
> > --xattrs-include=* to tar.

> The tar documentation suggests that just --xattrs should be enough:

> By default, when '--xattr' is used, all names are stored in the
> archive (or extracted, if using '--extract').

> Am I missing something?

Empirically derived, on bionic:

# mkdir /tmp/caps
# cd /tmp/caps/
# tar -c --xattrs /usr/bin/mtr-packet | tar -x
tar: Removing leading `/' from member names
# getcap usr/bin/mtr-packet
# tar -c --xattrs /usr/bin/mtr-packet | tar -x --xattrs
tar: Removing leading `/' from member names
# getcap usr/bin/mtr-packet
# tar -c --xattrs /usr/bin/mtr-packet | tar -x --xattrs-include=*
tar: Removing leading `/' from member names
# getcap usr/bin/mtr-packet
usr/bin/mtr-packet = cap_net_raw+ep
#

Same behavior on xenial.

So while the documentation may say it's not required, and we could fix the
implementation going forward to match the documentation (including in SRU in
Ubuntu), if this is an upstream bug this would still be an issue with
implementations in the wild.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org