ignore trailing garbage on decompress needed

Bug #594868 reported by Yavor Nikolov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pbzip2
Status tracked in Trunk
1.1
Fix Released
Low
Yavor Nikolov
2.0
New
Undecided
Unassigned
Trunk
New
Low
Yavor Nikolov

Bug Description

Add option-controlled functionality to ignore trailing garbage on decompression instead of failing with error.

This is in order to keep compatible with bzip2 and to prevent breaking existing code dealing with Gentoo package format.

Changed in pbzip2:
assignee: nobody → Yavor Nikolov (yavor-nikolov)
status: New → In Progress
Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

Working but still just barely tested implementation has been pushed to lp:~yavor-nikolov/pbzip2/pbzip2-1.1.x-yn-ignore-trailing.

The feature is switched on/off using following option:
--ignore-trailing-garbage=0 (Old behaviour - trailing garbage causes error and abort)
--ignore-trailing-garbage=1 (Trailing garbage is just ignored /printing just a warning about it if in verbose mode/)
--ignore-trailing-garbage (Same as --ignore-trailing-garbage=1)

The default value flag could be specified by conditional compilation with IGNORE_TRAILING_GARBAGE=<flag value>. (The default is 0).

Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

An additional suggestion (by Michał) came for the default parameter value:
"switching IgnoreTrailingGarbage on by default if the program is called as 'bzip2', 'bunzip2' or 'bzcat' (i.e. has no 'p' before)"

Changed in pbzip2:
status: In Progress → Fix Committed
Changed in pbzip2:
importance: Undecided → Low
milestone: none → 1.1.2
Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

A bit clarification about the bug and it's current fix: default behavior is still determined by IGNORE_TRAILING_GARBAGE macro only. (I.e. the Michał's idea to make some adjustments based on program name remained out of scope of this bug. New ones may be opened for further refinement in subsequent releases).

Revision history for this message
Yavor Nikolov (yavor-nikolov) wrote :

My last update here to be ignored... The program-name based default has been in fact already implemented as per the description in Makefile:

# Comment out CFLAGS line below to explicity set ignore trailing garbage
# default behavior: 0 - disabled; 1 - enabled (ignore garbage by default)
# If IGNORE_TRAILING_GARBAGE is not defined: behavior is automatically determined
# by program name: bzip2, bunzip2, bzcat - ignore garbage; otherwise - not.
#CFLAGS += -DIGNORE_TRAILING_GARBAGE=1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.