Hi Ian, thanks for the update!
On Monday 30 of May 2016 17:23:33 Ian McLeod wrote:
> On 05/30/2016 02:10 AM, Pavel Raiskup wrote:
> > 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.
If there is occurrence of --xattrs-include, tar does not store all
xattrs but only those which are specified:
620 static bool
621 xattrs_kw_included (const char *kw, bool archiving)
622 {
623 if (xattrs_setup.incl.size)
624 return xattrs_matches_mask (kw, &xattrs_setup.incl);
^^^^^^
625 else if (archiving)
626 return true;
^^^^^^ default case for 'tar -c --xattrs'
627 else
628 return strncmp (kw, USER_DOT_PFX, sizeof (USER_DOT_PFX) - 1) == 0;
629 }
So the --xattrs-include is to some extent useful (and testable), too.
Pavel