Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 618215

Summary: patch does not preserve context - resets to tmp_t
Product: Red Hat Enterprise Linux 6 Reporter: Eduard Benes <ebenes>
Component: patchAssignee: Tim Waugh <twaugh>
Status: CLOSED CURRENTRELEASE QA Contact: Eduard Benes <ebenes>
Severity: medium Docs Contact:
Priority: urgent    
Version: 6.0CC: dbaron, ebenes, gajownik, jorris, mkanat, mvadkert, nalin, pknirsch, sdsmall, syeghiay, twaugh, vchepkov
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: patch-2.6-6.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 229329 Environment:
Last Closed: 2010-11-10 21:19:50 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: 229329    
Bug Blocks:    

Comment 1 Tim Waugh 2010-07-26 15:19:18 UTC
*** Bug 616141 has been marked as a duplicate of this bug. ***

Comment 9 Miroslav Vadkerti 2010-08-16 09:02:26 UTC
Still fails with patch-2.6-5.el6. FAILS_QA, flipping back to assigned:

# rpm -q patch
patch-2.6-5.el6.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   PASS   ] :: Running 'echo example1 > /etc/example1'
:: [   PASS   ] :: Running 'echo example2 > /etc/example2'
:: [   PASS   ] :: File /etc/example1 should exist
:: [   PASS   ] :: File /etc/example2 should exist
-rw-r--r--. root root unconfined_u:object_r:etc_t:s0   /etc/example1
-rw-r--r--. root root unconfined_u:object_r:etc_t:s0   /etc/example2
:: [   PASS   ] :: Running 'ls -lZ /etc/example1 /etc/example2 | tee /tmp/before.log'
patching file /etc/example1
:: [   PASS   ] :: Running 'diff -u /etc/example1 /etc/example2 | patch /etc/example1'
-rw-r--r--. root root unconfined_u:object_r:user_tmp_t:s0 /etc/example1
-rw-r--r--. root root unconfined_u:object_r:etc_t:s0   /etc/example2
:: [   PASS   ] :: Running 'ls -lZ /etc/example1 /etc/example2 | tee /tmp/after.log'
:: [   FAIL   ] :: Files /tmp/before.log and /tmp/after.log should not differ

Comment 10 Tim Waugh 2010-08-16 16:59:52 UTC
I could reproduce that.

Fixed in patch-2.6-6.el6.

Comment 11 Miroslav Vadkerti 2010-08-17 07:17:10 UTC
VERIFIED as fixed in patch-2.6-6.el6

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   PASS   ] :: Running 'echo example1 > /etc/example1'
:: [   PASS   ] :: Running 'echo example2 > /etc/example2'
:: [   PASS   ] :: File /etc/example1 should exist
:: [   PASS   ] :: File /etc/example2 should exist
:: [   PASS   ] :: Running 'ls -lZ /etc/example1 /etc/example2 | tee /tmp/before.log'
:: [   PASS   ] :: Running 'diff -u /etc/example1 /etc/example2 | patch /etc/example1'
:: [   PASS   ] :: Running 'ls -lZ /etc/example1 /etc/example2 | tee /tmp/after.log'
:: [   PASS   ] :: Files /tmp/before.log and /tmp/after.log should not differ
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 8 good, 0 bad
:: [   PASS   ] :: RESULT: Test

Please note that this bug will be moved to VERIFIED state when it gets to RHEL6 Snap 12.

Comment 13 Miroslav Vadkerti 2010-08-19 07:07:59 UTC
Moving to verified per comment 11.

Comment 14 releng-rhel@redhat.com 2010-11-10 21:19:50 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.