Bug 466653 - "cp -Z" causes an error, and does not change the context
"cp -Z" causes an error, and does not change the context
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-10-12 01:53 EDT by Murray McAllister
Modified: 2015-01-04 17:35 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-10-12 12:46:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
tests and results of "cp -Z" (4.53 KB, text/plain)
2008-10-12 01:53 EDT, Murray McAllister
no flags Details

  None (edit)
Description Murray McAllister 2008-10-12 01:53:57 EDT
Created attachment 320134 [details]
tests and results of "cp -Z"

Description of problem:
"cp -Z [context] file1 testing/" copies file1 to testing/, but throws an error and does not change the context of "testing/file1", to the context specified with the cp command.

Version-Release number of selected component (if applicable):
* Fedora release 9.92 (Rawhide)
* coreutils-6.12-13.fc10.i386

* policycoreutils-2.0.57-1.fc10.i386
* selinux-policy-3.5.10-3.fc10.noarch
* libselinux-utils-2.0.73-1.fc10.i386
* libselinux-python-2.0.73-1.fc10.i386
* selinux-policy-targeted-3.5.10-3.fc10.noarch
* libselinux-2.0.73-1.fc10.i386

How reproducible:

Steps to Reproduce:
See attached for tests and results on rawhide, Fedora 9, and Red Hat Enterprise Linux 5.2
Actual results:
Error and context does not change:

$ ls -Z
-rw-r--r--  root root unconfined_u:object_r:default_t:s0 file1
drwxr-xr-x  root root unconfined_u:object_r:default_t:s0 testing
$ sudo cp -Z unconfined_u:object_r:samba_share_t:s0 file1 testing/
cp: cannot stat `unconfined_u:object_r:samba_share_t:s0': No such file or directory
$ ls -Z testing/
-rw-r--r--  root root unconfined_u:object_r:default_t:s0 file1

Expected results:
No errors, context changes.

Additional info:
* cp --context works as expected on rawhide, Fedora 9, and Red Hat Enterprise Linux 5.2.
* cp -Z works as expected on Red Hat Enterprise Linux 5.2 (see attached for version numbers).
* No AVC denials after using cp -Z.
Comment 1 Ondrej Vasik 2008-10-12 12:46:55 EDT
Thanks for report, fixed in coreutils-6.10-32.fc9 and coreutils-6.12-14.fc10, closing RAWHIDE.

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