Package: zstd
Version: 1.5.7+dfsg-4
X-Debbugs-CC: [email protected]

Dear Maintainer,

zstd seems to ignore the --format= option when doing decompression or
testing archives:

  $ head -c32 /dev/zero | gzip -c | zstd -dc --format=xz | xxd
  00000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
  00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................

  $ head -c32 /dev/zero | gzip -c | zstd -tc --format=xz; echo $?
  /*stdin*\           : 32 bytes
  0

Compare to xz which returns an error for a similar case:

  $ head -c32 /dev/zero | xz -c | xz -dc --format=lzma; echo $?
  xz: (stdin): File format not recognized
  1

>From the zstd manual page it's clear the option is meant to apply to
decompression as well:

  --format=FORMAT: compress and decompress in other formats. If compiled
  with support, zstd can compress to or decompress from  other  compres‐
  sion algorithm formats. Possibly available options are zstd, gzip, xz,
  lzma, and lz4. If no such format is provided, zstd is the default.

Properly returning an error when trying to decompress as a wrong format
instead of decompressing as an auto-detected correct format would help
scripts which try to figure out which compression scheme was used to
create an archive.


-- System Information:
Debian Release: forky/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable'), (1,
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64, armhf, i386

Kernel: Linux 7.1.8+deb14.1-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages zstd depends on:
ii  libc6       2.43-3
ii  libgcc-s1   16.2.0-1
ii  liblz4-1    1.10.0-10
ii  liblzma5    5.8.3-1
ii  libstdc++6  16.2.0-1
ii  zlib1g      1:1.3.dfsg+really1.3.2-3

zstd recommends no packages.

zstd suggests no packages.

-- no debconf information

Reply via email to