bug#78623: cp --preserve=xattr copies attr as well as xattr which breaks cross-FS copy

Gael Donval <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
> > `cp -a` offers that flexibility (good) but also silently drops
> > everything if any intermediary does not support xattrs (very bad). The
> > latter is relatively common on distributed FS but could also happen
> > depending on vendor/admin choices.
> > 
> > 
> > The current approach of setting up xattr copy rules in /etc/xattr.conf
> > is unwieldy:
> > 
> > 1. it does not work for non-root users;
> > 2. and does not allow for any call-specific adjustment.
> > 
> > Setting up a container so that a normal user can setup a scoped local
> > /etc/xattr.conf tailored to their use, to make a specific tree copy
> > checking for the existence of a minimal set of supported xattrs is a
> > bit convoluted.
> > 
> > Any alternative suggestion would be good.
> So you're suggesting supporting something like --xattrs-include=... and --xattrs-exclude.
> Looking now, I see that tar supports those exact options.
> Also rsync support xattr filtering though its --filter rules.
> This does give more control, though also less general control
> as one would need to config the xattrs for each particular system / call.
> Also given other archiving tools support this already,
> I'm not sure it's warranted in cp.

The only problem with rsync is that it doesn't support reflinks.
Otherwise it would be perfect (there is a series of patch that exist
since 2021 but no one ever merged them in main).

Gaël


> 
> cheers,
> Pádraig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.