Bug 189890 - patch does not respect SELinux type context on files
Summary: patch does not respect SELinux type context on files
Keywords:
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
medium
medium
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-25 15:28 UTC by Jon Orris
Modified: 2020-11-18 14:33 UTC (History)
1 user (show)

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


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.pl 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.pl
[test@test ~]$ patch -p0 test.pl test.diff
patching file test.pl
[test@test ~]$ ls -Z test.pl
-rw-rw-r--  test     test     user_u:object_r:tmp_t            test.pl

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.