Bug 14626 - gunzip -cf fails on uncompressed input
Summary: gunzip -cf fails on uncompressed input
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-01 17:53 UTC by Thomas Christensen II
Modified: 2022-03-01 17:53 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Christensen II 2022-03-01 17:53:21 UTC
Trying to decompress uncompressed output with Busybox gunzip will fail even with
the -cf flag passed. 

Steps to Reproduce
------------------

    echo "uncompressed content" >> file
    gunzip -cf file

Actual Results
--------------

    gunzip: invalid magic

Expected Results
----------------

    uncompressed content

This expected behavior is given by the man page for GNU gunzip:

> -f --force: If the input data is not in a format recognized by gzip, and
> if the option --stdout is also given, copy the input data without change to
> the standard output: let zcat behave as cat.

Build date & Hardware
---------------------

Unknown: I first encountered this in the biocontainers Docker images, and created the above example with the busybox:1.34.1-uclibc Docker image.