Hey Pavel,
On 05/30/2016 02:10 AM, Pavel Raiskup wrote:
Hi Ian,
On Sunday 29 of May 2016 16:20:00 Ian McLeod wrote:
* src/xattrs.c (xattrs_xattrs_get): apply exclude/include mask when
fetching extended attributes
This makes archive create behavior consistent with the documentation.
Without this change xattr include/exclude options are accepted when
creating an archive but are silently ignored.
Good catch, exclude/include is ignored during archive creation.
Could you please post smaller patch just having the important part:
+ if (!xattrs_masked_out(attr, true /* archiving */))
+ xheader_xattr_add (st, attr, val, aret);
(+ one prototype above). And could you please add one new testcase for
--xattrs-{exclude,include}?
Done.
Note that the added test only exercises exclude. As best I can tell,
--xattrs-include can never actually be meaningful when doing a create.
Any --xattrs-include implies --xattrs which, for create, starts with a
default of saving all xattrs. It's the ability to selectively _exclude_
that is fixed by this patch, and this is genuinely useful for some use
cases. In my case, I need this to work to prune certain xattrs when
generating tar files for Docker base image creation.
Thanks!
Pavel