Bug 189216 - Bad return code when compressing 0 length files
Summary: Bad return code when compressing 0 length files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ncompress
Version: 4.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Peter Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: FAST4.5APPROVED
TreeView+ depends on / blocked
 
Reported: 2006-04-18 13:43 UTC by David Kovalsky
Modified: 2014-03-31 23:43 UTC (History)
1 user (show)

Fixed In Version: RHSA-2006-0663
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-12 16:47:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
this patch fix both #189215 and #189216 (636 bytes, patch)
2006-04-21 12:05 UTC, Peter Vrabec
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0663 0 normal SHIPPED_LIVE Low: ncompress security update 2006-09-12 04:00:00 UTC

Description David Kovalsky 2006-04-18 13:43:50 UTC
Description of problem:
Returns different return code when compressing (actually no compression is done
because the -f parameter was not specified) 0 length files then when compressing
(actually not, because the resulting file is larger, see above) small files.
$ touch foo
$ compress foo
$ echo $?
0

$ echo jkl>bar
$ compress bar
$ echo $?
2

$ ll
-rw-r--r--  1 nfsnobody devqa5 4 Apr 13 04:21 bar
-rw-r--r--  1 nfsnobody devqa5 0 Apr 13 04:18 foo

Same behaviour, different return code. When files are not changed (output is
larger than input) then the return code (according to man pages and behavior in
similar cases) should be 2.

Version-Release number of selected component (if applicable):
ncompress-4.2.4-40
ncompress-4.2.4-41.rhel4

How reproducible:
always

Steps to Reproduce:
1.
$ touch foo
$ compress foo
$ echo $?
0


2.
$ echo jkl>bar
$ compress bar
$ echo $?
2

  
Actual results:
0

Expected results:
2

Additional info:

Comment 1 Peter Vrabec 2006-04-21 12:05:38 UTC
Created attachment 128079 [details]
this patch fix both #189215 and #189216

Comment 10 Red Hat Bugzilla 2006-09-12 16:47:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2006-0663.html



Note You need to log in before you can comment on or make changes to this bug.