Bug 189970 - cp -Z doesn't set the SE Linux context if a file exists
cp -Z doesn't set the SE Linux context if a file exists
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On:
Blocks: 176344
  Show dependency treegraph
Reported: 2006-04-26 07:08 EDT by Russell Coker
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0213
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-01 18:53:39 EDT
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 Russell Coker 2006-04-26 07:08:33 EDT
This is the same problem reported in bug #189967 for rawhide.

Description of problem:

The command "cp -Z root:object_r:tmp_t file-a file-b" does not set the context 
of file-b if it already exists.  If the file does not exist then it operates 

This is because the "-Z" option of cp sets the default context for new files 
that are created.  If a file exists then cp does not unlink and recreate it, 
but instead just truncates it.

When we have devised a suitable solution for this in rawhide we need to 
determine whether it's worth back-porting it to RHEL.  This bug was first 
discovered by a student in the RH427 SE Linux training course.
Comment 2 Russell Coker 2006-07-19 00:44:12 EDT
What's the status of this?  Is it likely to be in RHEL4U4?

Would it help if I back-ported the fix from rawhide?
Comment 3 Tim Waugh 2006-07-19 06:23:55 EDT
Proposed patches can always speed things up. :-)

However, I don't currently expect this fix to be included in Red Hat Enterprise
Linux 4.4.
Comment 4 RHEL Product and Program Management 2006-08-18 12:05:06 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 11 Red Hat Bugzilla 2007-05-01 18:53:39 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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