Bug 202823

Summary: cp -a doesn't copy user/root xattrs
Product: [Fedora] Fedora Reporter: James Antill <james.antill>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: kdudka, meyering, mishu, ovasik, redhat-bugzilla, triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: coreutils-7.0-7.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-28 18:27:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 235704    
Description Flags
Generic xattr support for cp and mv
Suggestions from Jim none

Description James Antill 2006-08-16 16:36:48 UTC
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 16:36:48 UTC
Created attachment 134320 [details]
Generic xattr support for cp and mv

Comment 2 James Antill 2006-08-28 07:49:21 UTC
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 17:57:26 UTC
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 09:57:36 UTC
Removing NEEDINFO, keeping ASSIGNED against rawhide.

Comment 5 Bug Zapper 2008-05-14 02:17:10 UTC
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 08:59:02 UTC
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 18:27:08 UTC
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.