This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=6f642ffc3a72414da2ecb0b954b6460744bc4b00

commit 6f642ffc3a72414da2ecb0b954b6460744bc4b00
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Apr 16 03:43:58 2025 +0200

    Pass --format=xz explicitly to xz on decompression
    
    We should make sure we are really decompressing an xz stream when we
    expect to find one, instead of relying on the tool autodetecting any
    supported format.
---
 lib/dpkg/compress.c         | 1 +
 scripts/Dpkg/Compression.pm | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/dpkg/compress.c b/lib/dpkg/compress.c
index 27c94a4e1..1e1151423 100644
--- a/lib/dpkg/compress.c
+++ b/lib/dpkg/compress.c
@@ -803,6 +803,7 @@ decompress_xz(struct compress_params *params, int fd_in, 
int fd_out,
        char *threads_opt = NULL;
 
        command_decompress_init(&cmd, XZ, desc);
+       command_add_arg(&cmd, "--format=xz");
 
        if (params->threads_max > 0) {
                threads_opt = str_fmt("-T%d", params->threads_max);
diff --git a/scripts/Dpkg/Compression.pm b/scripts/Dpkg/Compression.pm
index 9e6074d18..bd69d5e4d 100644
--- a/scripts/Dpkg/Compression.pm
+++ b/scripts/Dpkg/Compression.pm
@@ -81,7 +81,7 @@ my %COMP = (
     xz => {
        file_ext => 'xz',
        comp_prog => [ 'xz' ],
-       decomp_prog => [ 'unxz' ],
+       decomp_prog => [ 'unxz', '--format=xz' ],
        default_level => 6,
     },
 );

-- 
Dpkg.Org's dpkg

Reply via email to