cp: -a now preserves SELinux context, with reduced diagnostics
commit8c243ff965d477a89582a1b329923516a4d64668
authorOndřej Vašík <ovasik@redhat.com>
Tue, 17 Feb 2009 14:53:39 +0000 (17 15:53 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 18 Feb 2009 14:27:10 +0000 (18 15:27 +0100)
treeb0b9d6e5c1d4f3b9aa0134ffe327b1c9ddec4aed
parent86cef85b3671ed0a14a444eef3b6cb07fa26ee64
cp: -a now preserves SELinux context, with reduced diagnostics

* copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'.
(copy_internal): Likewise
* copy.h (cp_options): Add boolean reduce_diagnostics.
* cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all.
(cp_option_init): Initialize added reduce_diagnostics.
(main): Add reduce_diagnostics for the -a option, and preserve SELinux
context, if possible.
* mv.c (cp_options_init): Initialize new cp_options booleans.
* install.c (cp_option_init): Likewise.
* NEWS: Mention those behaviour changes.
* doc/coreutils.texi: Document --preserve=context, document that
diagnostics are not shown for failures of non-mandatory attributes
(just SELinux at the moment).
* tests/cp/cp-a-selinux: Check not only failures, but succesful use
of preserving SELinux context in cp.
NEWS
doc/coreutils.texi
src/copy.c
src/copy.h
src/cp.c
src/install.c
src/mv.c
tests/cp/cp-a-selinux