Ondřej Vašík wrote: > Hello, > I sent patch about cp -a and it's failure to preserve SELinux context in > October 08.
I missed that. > Meanwhile xattr support was added to cp. As described in > info pages -a option means "Preserve as much as possible of the > structure and attributes of the original files". Therefore it should > preserve xattr if possible as well. > > After patch it should work like: > 1) cp -a tries to preserve SELinux context and xattr, but doesn't inform > about possible failures > 2) cp --preserve=all tries to preserve SELinux context and xattr, but > does inform about failures and doesn't fail if xattr/SELinux context are > not preserved > 3) cp --preserve=context,xattr obviously tries to preserve attributes, > inform about failures and does fail if xattr/SELinux context is not > preserved I wondered about this in my review of Kamil's xattr patch... "I'm a bit surprised that -a doesn't copy xattrs actually: -a does copy ACLs (but doesn't copy [selinux] context), but I guess if xattrs are a superset of SELinux context, then that's consistent." So making -a copy everything possible without warnings seems sensible to me. Note ACLs are copied when --preserve=mode is specified/implied. > NOTE: Added documentation of --preserve=context, description of current > behaviour to cp --preserve=all and cp -a documentation. Added tests to > ensure that cp -a actually works with SELinux (until now it was checking > just failures. I also wondered why there was no documentation of --preserve=context so +1 from me cheers, Pádraig. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
