All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/6 v2] fs/tar: add support for xattrs (thus capabilties)
Date: Mon, 12 Nov 2018 18:33:12 +0100	[thread overview]
Message-ID: <0b788d4ef7c7f0d02c1a15b31a69d08de3401abe.1542043922.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1542043922.git.yann.morin.1998@free.fr>

By default, tar will not include any extended attribute (xattr) when
creating archives, and thus will not store capabilties either (as they
are stored in the xattr 'security.capability').

Using option --xattrs is enough to create a tarball with all the xattrs
attached to a file. However, extracting all xattrs from a tarball
requires that --xattrs-include='*' be used. This is not symetric (but on
purpose, as per the documentation), and so is confusing to some.

So, we use --xattrs-include='*' to create the archive, so as to be
explicit that we want all xattrs to be stored.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
 fs/tar/tar.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/tar/tar.mk b/fs/tar/tar.mk
index 68149e9eb7..4c6327ace8 100644
--- a/fs/tar/tar.mk
+++ b/fs/tar/tar.mk
@@ -10,7 +10,7 @@ ROOTFS_TAR_DEPENDENCIES = $(BR2_TAR_HOST_DEPENDENCY)
 
 define ROOTFS_TAR_CMD
 	(cd $(TARGET_DIR); find -print0 | LC_ALL=C sort -z | \
-		tar $(TAR_OPTS) -cf $@ --null --no-recursion -T - --numeric-owner)
+		tar $(TAR_OPTS) -cf $@ --null --xattrs-include='*' --no-recursion -T - --numeric-owner)
 endef
 
 $(eval $(rootfs))
-- 
2.14.1

  parent reply	other threads:[~2018-11-12 17:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 17:32 [Buildroot] [PATCH 0/6 v2] fs: fix and better handle capabilities Yann E. MORIN
2018-11-12 17:33 ` [Buildroot] [PATCH 1/6 v2] fs: get over the intermediate tarball Yann E. MORIN
2018-11-12 23:48   ` Arnout Vandecappelle
2018-11-12 17:33 ` Yann E. MORIN [this message]
2018-11-12 22:09   ` [Buildroot] [PATCH 2/6 v2] fs/tar: add support for xattrs (thus capabilties) Arnout Vandecappelle
2018-11-12 22:28     ` Arnout Vandecappelle
2018-11-21  6:15   ` Peter Korsgaard
2018-11-12 17:33 ` [Buildroot] [PATCH 3/6 v2] fs: rename internal variable Yann E. MORIN
2018-11-12 22:38   ` Arnout Vandecappelle
2018-12-03 20:30   ` Thomas Petazzoni
2018-11-12 17:33 ` [Buildroot] [PATCH 4/6 v2] fs: split devices and permissions tables Yann E. MORIN
2018-11-12 22:46   ` Arnout Vandecappelle
2018-11-12 17:33 ` [Buildroot] [PATCH 5/6 v2] fs: allow user provided permissions to override packages permissions Yann E. MORIN
2018-11-12 17:33 ` [Buildroot] [PATCH 6/6 v2] fs: make static device nodes creation more logical Yann E. MORIN
2018-12-03 20:55   ` Thomas Petazzoni
2018-11-12 22:30 ` [Buildroot] [PATCH 0/6 v2] fs: fix and better handle capabilities Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b788d4ef7c7f0d02c1a15b31a69d08de3401abe.1542043922.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.