Bug 802006 - cp -avZ behaves incorrectly on a system without SELinux
cp -avZ behaves incorrectly on a system without SELinux
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-03-10 02:12 EST by Adam Pribyl
Modified: 2012-03-10 02:51 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-03-10 02:51:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adam Pribyl 2012-03-10 02:12:59 EST
Description of problem:
cp -avZ does not copy a first directory in a bash expanded list, while cp -av works OK on a system where SELinux is not enabled.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. mkdir -p cptest/bin cptest/nonbin cptarget
2. cp -avZ cptest/* cptarget/
Actual results:
Warning:  ignoring --context (-Z). It requires a SELinux enabled kernel.
`cptest/nonbin' -> `cptarget/nonbin'

Only nonbin subdir si copied. The bin subdir is skipped.

Expected results:
cp -av copies both dirs.

This is true for both i686 and x86_64.
Comment 1 Ondrej Vasik 2012-03-10 02:51:17 EST
Thanks for report, but sorry - this not a bug. This is expected behaviour and misusing -Z option. Non-upstream, now deprecated -Z option requires an argument - to which the context of the destination files is set - therefore the first argument is "eaten" and skipped.

Note You need to log in before you can comment on or make changes to this bug.