diff options
author | Ondřej Vašík <ovasik@redhat.com> | 2009-02-17 15:53:39 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-02-18 15:27:10 +0100 |
commit | 8c243ff965d477a89582a1b329923516a4d64668 (patch) | |
tree | b0b9d6e5c1d4f3b9aa0134ffe327b1c9ddec4aed /doc | |
parent | 86cef85b3671ed0a14a444eef3b6cb07fa26ee64 (diff) | |
download | coreutils-8c243ff965d477a89582a1b329923516a4d64668.tar.xz |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index ba1e74e30..42234d36a 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -7262,7 +7262,10 @@ Preserve as much as possible of the structure and attributes of the original files in the copy (but do not attempt to preserve internal directory structure; i.e., @samp{ls -U} may list the entries in a copied directory in a different order). -Equivalent to @option{-dpR}. +Try to preserve SELinux security context, but ignore any failure to do that +and print no corresponding diagnostic. +This option does not preserve extended attributes(xattr) at the moment. +Equivalent to @option{-dR --preserve=all} with a few exceptions. @item -b @itemx @w{@kbd{--backup}[=@var{method}]} @@ -7404,6 +7407,9 @@ Preserve in the destination files any links between corresponding source files. @c Give examples illustrating how hard links are preserved. @c Also, show how soft links map to hard links with -L and -H. +@itemx context +Preserve SELinux security context of the file. @command{cp} will fail +if the preserving of SELinux security context is not succesful. @itemx xattr Preserve extended attributes if @command{cp} is built with xattr support, and xattrs are supported and enabled on your file system. @@ -7411,7 +7417,10 @@ If SELinux context and/or ACLs are implemented using xattrs, they are preserved by this option as well. @itemx all Preserve all file attributes. -Equivalent to specifying all of the above. +Equivalent to specifying all of the above, but with the difference +that failure to preserve SELinux security context or extended attributes +does not change @command{cp}'s exit status. +@command{cp} does diagnose such failures. @end table Using @option{--preserve} with no @var{attribute_list} is equivalent |