All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/6 v2] fs/tar: add support for xattrs (thus capabilties)
Date: Mon, 12 Nov 2018 23:28:57 +0100	[thread overview]
Message-ID: <fdd1869f-9d76-138c-06a4-e3be4dcffddc@mind.be> (raw)
In-Reply-To: <f15d05f6-0b97-3c9a-d485-71e181ad7a6e@mind.be>


On 12/11/2018 23:09, Arnout Vandecappelle wrote:
>
> On 12/11/2018 18:33, Yann E. MORIN wrote:
>> 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').
>  So... currently capabilities are not included at all in the tarball, since
> --xattrs is not passed at the moment?
>
>  But after this patch, they are still not included? Or does --xattrs-include
> imply --xattrs?

?Tested and confirmed: --xattrs-include implies --xattrs. At least in my tar
1.29. So

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


?Regards,
?Arnout


>
>> 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)
>  I think --xattrs-include should come before TAR_OPTS, so it can still be
> overridden. Ah, darn, never mind, it can't be overridden, several
> --xattrs-include options are cumulative and their order doesn't matter.
>
>  Regards,
>  Arnout
>
>>  endef
>>  
>>  $(eval $(rootfs))
>>

  reply	other threads:[~2018-11-12 22:28 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 ` [Buildroot] [PATCH 2/6 v2] fs/tar: add support for xattrs (thus capabilties) Yann E. MORIN
2018-11-12 22:09   ` Arnout Vandecappelle
2018-11-12 22:28     ` Arnout Vandecappelle [this message]
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=fdd1869f-9d76-138c-06a4-e3be4dcffddc@mind.be \
    --to=arnout@mind.be \
    --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.