Bug 189970

Summary: cp -Z doesn't set the SE Linux context if a file exists
Product: Red Hat Enterprise Linux 4 Reporter: Russell Coker <rcoker>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: meyering
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0213 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-01 22:53:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 176344    

Description Russell Coker 2006-04-26 11:08:33 UTC
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 
correctly.

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 04:44:12 UTC
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 10:23:55 UTC
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 Program Management 2006-08-18 16:05:06 UTC
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
release.

Comment 11 Red Hat Bugzilla 2007-05-01 22:53:39 UTC
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.

http://rhn.redhat.com/errata/RHBA-2007-0213.html