Bug 802006

Summary: cp -avZ behaves incorrectly on a system without SELinux
Product: [Fedora] Fedora Reporter: Adam Pribyl <covex>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: kdudka, maxamillion, ovasik, p, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-10 02:51:17 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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):
8.12-6.fc16.x86_64

How reproducible:
Always

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.