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 1084558

Summary: patch false positive return code???
Product: Red Hat Enterprise Linux 6 Reporter: David Brown <david.brown>
Component: patchAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-09 10:36:08 UTC Type: Bug
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: 1084555    
Bug Blocks:    
Attachments:
Description Flags
patch to apply
none
The perl file to apply the patch to
none
Updated perl without the original patch applied none

Description David Brown 2014-04-04 16:34:14 UTC
Created attachment 882786 [details]
patch to apply

Description of problem:


Okay here's some information as to what I've gathered so far...

Please disregard the content of the code I'm greping for key words
only to call out the behavior I'm seeing.

So I think patch is reporting a false positive when trying to
apply the patch and I'm unsure of expected behavior.

$ grep '^+.*named_listen_rules' xcat-2.8-named-bind-port.patch | wc -l
7
$ grep named_listen_rules ddns.pm | wc -l
0

So after some inspection of the patch and the code you should expect
if the patch applies to see 7 new lines with 'named_listen_rules' in
the ddns.pm file.

$ patch -p5 < xcat-2.8-named-bind-port.patch 
patching file ddns.pm
Hunk #1 succeeded at 482 (offset 71 lines).
$ echo $?
0

All seems fine to me nothing in the output or the return code seems
to indicate an error, just simply a warning about an offset in one
of the hunks. However after another grep.

$ grep named_listen_rules ddns.pm | wc -l
5

Seems patch only applied the first hunk and didn't apply the second
hunk of the patch file. Is this really expected behaviour?!?!?!

Version-Release number of selected component (if applicable):
patch-2.7.1-7.fc20.x86_64
patch-2.6-6.el6.x86_64

How reproducible:
Very

Actual results:
The first hunk of the patch was applied with the second seems to be
ignored entirely

Expected results:
I expected both hunks of the patch to be applied.


Additional info:
I'm concerned this is a 'feature' in patch, so my actual concern is the
way rpmbuild is calling patch to make sure there aren't some hidden
unpatched hunks that are silently being forgotten in all the patches both
Fedora and Redhat has.

Comment 1 David Brown 2014-04-04 16:34:43 UTC
Created attachment 882787 [details]
The perl file to apply the patch to

Comment 2 David Brown 2014-04-04 16:59:23 UTC
The Fedora bug is #1084555

Comment 4 David Brown 2014-04-07 14:49:25 UTC
Created attachment 883637 [details]
Updated perl without the original patch applied

Sorry, thought this was the one that wasn't applied, looks like I did that on a different system.

Comment 5 Tim Waugh 2014-04-09 10:36:08 UTC
The input is incorrect (see bug #1084555). Closing.