summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2009-01-23 12:17:53 +0100
committerJim Meyering <meyering@redhat.com>2009-01-29 13:26:07 +0100
commit0889381cbfdbb4895e6b8693d14c0f5c77bc85bc (patch)
tree1c93168a0d0c7e5ff72df37c4b34607b0eb3aaea /doc
parent1bdf77ad523fca6f3781f5614706246f20394a62 (diff)
downloadcoreutils-0889381cbfdbb4895e6b8693d14c0f5c77bc85bc.tar.xz
cp/mv: add xattr support
This patch was originally written by Andreas Grünbacher, nowadays available at http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff * bootstrap.conf: Add gnulib module verror. * po/POTFILES.in: Add lib/verror.c. * m4/xattr.m4: Check for libattr availability, new configure option --disable-xattr. * m4/prereq.m4: Require gl_FUNC_XATTR. * src/Makefile.am: Link cp, mv and ginstall with libattr. * src/copy.h: Add preserve_xattr and require_preserve_xattr to cp_options. * src/copy.c (copy_attr_error): New function to handle errors during xattr copying. (copy_attr_quote): New function to quote file name in error messages printed by libattr. (copy_attr_free): Empty function requested by libattr to free quoted string. (copy_attr_by_fd): New fd-oriented function to copy xattr. (copy_attr_by_name): New name-oriented function to copy xattr. (copy_reg, copy_internal): Call copy_extended_attributes function. * src/cp.c (usage): Mention new --preserve=xattr option. (decode_preserve_arg): Handle new --preserve=xattr option. * src/mv.c: Always attempt to preserve xattr. * src/install.c: Never attempt to preserve xattr. * tests/misc/xattr: New test for xattr support in cp, mv and install. * tests/Makefile.am: Add the new test to list. * doc/coreutils.texi: Mention xattr support, new --preserve=xattr option. * NEWS: Mention the change.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index d8b90876d..7ba872ebb 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7365,7 +7365,7 @@ symbolic links in the destination are always followed if possible.
@itemx @w{@kbd{--preserve}[=@var{attribute_list}]}
@opindex -p
@opindex --preserve
-@cindex file information, preserving
+@cindex file information, preserving, extended attributes, xattr
Preserve the specified attributes of the original files.
If specified, the @var{attribute_list} must be a comma-separated list
of one or more of the following strings:
@@ -7392,6 +7392,11 @@ 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 xattr
+Preserve extended attributes if @command{cp} is built with xattr support,
+and xattrs are supported and enabled on your file system.
+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.
@@ -7935,6 +7940,9 @@ attributes of destination files. It is typically used in Makefiles to
copy programs into their destination directories. It refuses to copy
files onto themselves.
+@cindex extended attributes, xattr
+@command{install} never preserves extended attributes (xattr).
+
The program accepts the following options. Also see @ref{Common options}.
@table @samp
@@ -8083,6 +8091,9 @@ directory succeeded, but the second didn't, the first would be left on
the destination partition and the second and third would be left on the
original partition.
+@cindex extended attributes, xattr
+@command{mv} always tries to copy extended attributes (xattr).
+
@cindex prompting, and @command{mv}
If a destination file exists but is normally unwritable, standard input
is a terminal, and the @option{-f} or @option{--force} option is not given,