Bug 202823 - cp -a doesn't copy user/root xattrs
cp -a doesn't copy user/root xattrs
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kamil Dudka
Depends On:
Blocks: F8Target
  Show dependency treegraph
Reported: 2006-08-16 12:36 EDT by James Antill
Modified: 2009-01-28 13:27 EST (History)
6 users (show)

See Also:
Fixed In Version: coreutils-7.0-7.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-28 13:27:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Generic xattr support for cp and mv (6.09 KB, patch)
2006-08-16 12:36 EDT, James Antill
no flags Details | Diff
Suggestions from Jim (14.16 KB, patch)
2006-08-28 03:49 EDT, James Antill
no flags Details | Diff

  None (edit)
Description James Antill 2006-08-16 12:36:48 EDT
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...)

Additional info:

 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.
Comment 1 James Antill 2006-08-16 12:36:48 EDT
Created attachment 134320 [details]
Generic xattr support for cp and mv
Comment 2 James Antill 2006-08-28 03:49:21 EDT
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
patch, right?:).
 I'll test and look at adding test cases, submit upstream etc. and let you
Comment 3 Bug Zapper 2008-04-03 13:57:26 EDT
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.
Comment 4 Ondrej Vasik 2008-04-25 05:57:36 EDT
Removing NEEDINFO, keeping ASSIGNED against rawhide.
Comment 5 Bug Zapper 2008-05-13 22:17:10 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 6 Kamil Dudka 2008-10-10 04:59:02 EDT
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.
Comment 7 Kamil Dudka 2009-01-28 13:27:08 EST
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.

Note You need to log in before you can comment on or make changes to this bug.