diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-04-12 08:46:37 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-04-12 10:06:11 +0100 |
commit | c420cfef77b9173a754806dc49deacabb436044f (patch) | |
tree | b0032e660a6fa03cd375429b75494191bd65824b /src/copy.h | |
parent | be9a42e7ac4905a84fa18709c76aaadbfbe6108b (diff) | |
download | coreutils-c420cfef77b9173a754806dc49deacabb436044f.tar.xz |
doc: clarify when cp and mv output xattr warnings
The 2010-03-26 commit, 4c38625e, "doc: fix info on cp --preserve..."
was not entirely correct as cp --preserve=all does produce some
xattr warnings.
* src/copy.h: Update and clarify the comments for reduce_diagnostics
and require_preserve_{xattr,context}.
* doc/coreutils.texi (cp invocation): Update the -a and
--preserve=xattr,context options to say when and which
xattr warnings are output.
(mv invocation): Mention that some warnings are output
when preserving xattrs.
Diffstat (limited to 'src/copy.h')
-rw-r--r-- | src/copy.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/copy.h b/src/copy.h index bd7359fe5..59e29f53b 100644 --- a/src/copy.h +++ b/src/copy.h @@ -180,15 +180,13 @@ struct cp_options Set this only if the kernel is SELinux enabled. */ bool preserve_security_context; - /* Useful only when preserve_security_context is true. - If true, a failed attempt to preserve a file's security context - propagates failure "out" to the caller. If false, a failure to - preserve a file's security context does not change the invoking - application's exit status. Give diagnostics for failed syscalls - regardless of this setting. For example, with "cp --preserve=context" - this flag is "true", while with "cp -a", it is false. That means - "cp -a" attempts to preserve any security context, but does not - fail if it is unable to do so. */ + /* Useful only when preserve_context is true. + If true, a failed attempt to preserve file's security context + propagates failure "out" to the caller, along with full diagnostics. + If false, a failure to preserve file's security context does not + change the invoking application's exit status, but may output diagnostics. + For example, with `cp --preserve=context` this flag is "true", + while with `cp --preserve=all` or `cp -a`, it is "false". */ bool require_preserve_context; /* If true, attempt to preserve extended attributes using libattr. @@ -197,16 +195,19 @@ struct cp_options /* Useful only when preserve_xattr is true. If true, a failed attempt to preserve file's extended attributes - propagates failure "out" to the caller. If false, a failure to - preserve file's extended attributes does not change the invoking - application's exit status. Give diagnostics for failed syscalls - regardless of this setting. For example, with "cp --preserve=xattr" - this flag is "true", while with "cp --preserve=all", it is false. */ + propagates failure "out" to the caller, along with full diagnostics. + If false, a failure to preserve file's extended attributes does not + change the invoking application's exit status, but may output diagnostics. + For example, with `cp --preserve=xattr` this flag is "true", + while with `cp --preserve=all` or `cp -a`, it is "false". */ bool require_preserve_xattr; - /* Used as difference boolean between cp -a and cp -dR --preserve=all. - If true, non-mandatory failure diagnostics are not displayed. This - should prevent poluting cp -a output. + /* This allows us to output warnings in cases 2 and 4 below, + while being quiet for case 1 (when reduce_diagnostics is true). + 1. cp -a try to copy xattrs with no errors + 2. cp --preserve=all copy xattrs with all but ENOTSUP warnings + 3. cp --preserve=xattr,context copy xattrs with all errors + 4. mv copy xattrs with all but ENOTSUP warnings */ bool reduce_diagnostics; |