Bug 1193603

Summary: rpmbuild ignores corrupt compressed patches
Product: [Fedora] Fedora Reporter: Pádraig Brady <pbrady>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: codonell, ffesti, jzeleny, kdudka, lkardos, novyjindrich, packaging-team-maint, rvokal
Target Milestone: ---Keywords: EasyFix
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-18 12:33:57 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:
Attachments:
Description Flags
improve detection of bzip2 format patches
none
fail with corrupt compressed patches none

Description Pádraig Brady 2015-02-17 17:00:24 UTC
There were two issues identified with the latest glibc build for f22,
where a patch was silently dropped with an easy to miss warning:

  Patch #1000 (glibc-swbz17949.patch):
  + /usr/bin/bzip2 -dc /home/carlos/fedsrc/glibc-f22/glibc-swbz17949.patch
  + /usr/bin/patch -p1 --fuzz=0
  bzip2: /home/carlos/fedsrc/glibc-f22/glibc-swbz17949.patch is not a bzip2 file.

The reason the patch was "corrupt" was due to invalid detection of bzip2 format.

The reason the failure was ignored was due to the pipe having the status
of the last patch command, which read nothing.

Comment 1 Pádraig Brady 2015-02-17 17:01:20 UTC
Created attachment 992809 [details]
improve detection of bzip2 format patches

Comment 2 Pádraig Brady 2015-02-17 17:02:27 UTC
Created attachment 992814 [details]
fail with corrupt compressed patches

Comment 3 Carlos O'Donell 2015-02-17 22:05:14 UTC
For the record the patch on the glibc side is a simple text file that happened to cotnain "BZ #XXXX" in the start of the patch file, and that triggered a heuristic to detect it as a bzip2 file. The heuristic needs expanding. It should take into account the encoding of the file and subsequent content.

Comment 4 Florian Festi 2015-03-18 12:33:57 UTC
Committed upstream as f793add4ae429e11664b403df4c32a73bc31a6e8 and d9f673bf2841bb8c854e6676871078ab563a51c9.

Thanks for spotting and the patches!

Closing this here as it is probably not urgent enough to issue an Fedora update.