Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 189890 - patch does not respect SELinux type context on files
patch does not respect SELinux type context on files
Status: CLOSED DUPLICATE of bug 165799
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: patch (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2006-04-25 11:28 EDT by Jon Orris
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-04-25 11:49:47 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 Jon Orris 2006-04-25 11:28:31 EDT
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 11:49:47 EDT

*** 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.