Bug 281998 - bsdunzip extract from stdin broken
Summary: bsdunzip extract from stdin broken
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.4-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-10-11 00:16 UTC by Ivan
Modified: 2025-05-16 14:40 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2024-10-11 00:16:37 UTC
# ls /usr/bin/unzip
lrwxr-xr-x  1 root  wheel     8B Sep 28 14:08 /usr/bin/unzip@ -> bsdunzip
# /usr/bin/bsdunzip -
Usage: unzip [-aCcfjLlnopqtuvyZ1] [{-O|-I} encoding] [-d dir] [-x pattern] [-P password] zipfile
             [member ...]

My script broken after upgrading to 13.3, because /usr/bin/unzip was replaced by link to bsdunzip

man page of bsdunzip says: "If specified filename is "-", then data is read from stdin.", but it is broken.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2024-10-11 00:22:24 UTC
Looks like we switched to libarchive's version in commit b5a3a89c50671a1ad29e7c43fe15e7b16feac239.  bsdunzip.c appears to have handling for "-" but it's broken indeed.

Martin, could you take a look?
Comment 2 Ivan 2025-05-09 09:22:11 UTC
still no fix?
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2025-05-16 14:40:48 UTC
The problem looks related to libarchive's option parser.

`bsdunzip -- -` works as expected, I believe, so that's a workaround.