Red Hat Bugzilla – Bug 202823
cp -a doesn't copy user/root xattrs
Last modified: 2009-01-28 13:27:08 EST
Description of problem:
user/root xattrs aren't copied (in fact only selinux and posix_acl's are copied
... but we don't have any other non user/root xattrs apart from those, so...)
I've created a path for coreutils which does this for cp/mv, there is one minor
quible in that xattr_delete() should be in libattr. But I don't want the
coreutils update to depend on a newer libattr.
Upstream will rightfully want that though.
I'm also not 100% that cp shouldn't also call xattr_delete(), but it's
defenadable and fits how ACLs currently work in coreutils and setfattr.
Created attachment 134320 [details]
Generic xattr support for cp and mv
Created attachment 135027 [details]
Suggestions from Jim
This is the fixes that Jim pointed out (note untested, but not much code
changed). Also added --preserve=acls (hopefully changing the right bits) and
documentation for xattrs, ACLs and SELinux.
I haven't even compiled this yet, but it has to be better than the first
I'll test and look at adding test cases, submit upstream etc. and let you
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.
If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)
Thanks for your help, and we apologize again that we haven't handled
these issues to this point.
The process we're following is outlined here:
We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Removing NEEDINFO, keeping ASSIGNED against rawhide.
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
I found this already solved in Gentoo Linux - look at patch patch/004_all_coreutils-acl-xattr.patch from http://dev.gentoo.org/~vapier/dist/coreutils-6.12-patches-1.0.tar.lzma. Now I am trying to contact original author first.
Fixed in rawhide. Note that cp -a still doesn't copy user/root xattrs. The appropriate cp option is --preserve=xattr. mv always preserves xattrs, install never preserves xattrs.