Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 189890 - patch does not respect SELinux type context on files
Summary: patch does not respect SELinux type context on files
Status: CLOSED DUPLICATE of bug 165799
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: patch
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2006-04-25 15:28 UTC by Jon Orris
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-04-25 15:49:47 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Jon Orris 2006-04-25 15:28:31 UTC
patch-2.5.4-20 on U3.

Description of problem:

patch always changes the context type of a file to tmp_t. Example:

[test@test ~]$ ls -Z test.diff
-rw-rw-r--  test     test     user_u:object_r:user_home_t      test.diff
-rw-rw-r--  test     test     user_u:object_r:user_home_t
[test@test ~]$ patch -p0 test.diff
patching file
[test@test ~]$ ls -Z
-rw-rw-r--  test     test     user_u:object_r:tmp_t  

This can cause unexpected permssion errors when using the patched file; for
example, if it were a cgi script or libary with type httpd_sys_content_t, the
context change can cause odd permission errors.

Although straightforward to work around, it would be nice if patch would handle
the type cleanup itself.

Comment 1 Tim Waugh 2006-04-25 15:49:47 UTC

*** This bug has been marked as a duplicate of 165799 ***

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