Red Hat Bugzilla – Bug 189970
cp -Z doesn't set the SE Linux context if a file exists
Last modified: 2007-11-30 17:07:24 EST
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.
What's the status of this? Is it likely to be in RHEL4U4?
Would it help if I back-ported the fix from rawhide?
Proposed patches can always speed things up. :-)
However, I don't currently expect this fix to be included in Red Hat Enterprise
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
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.