From ebab4454efc4d00ea0e4488d6e35741bdb738d40 Mon Sep 17 00:00:00 2001 From: Roy Oursler Date: Tue, 4 Dec 2018 17:12:25 -0700 Subject: [PATCH] igzip: Fix cli to verify checksum when decompressing Change-Id: Ifa4d0eb5345bc3c3e97a23e3e32c732057bd8ba9 Signed-off-by: Roy Oursler --- programs/igzip.1 | 2 +- programs/igzip_cli.c | 2 +- programs/igzip_cli_check.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/programs/igzip.1 b/programs/igzip.1 index ce13e97..07c8597 100644 --- a/programs/igzip.1 +++ b/programs/igzip.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.7. -.TH IGZIP "1" "November 2018" "igzip command line interface 2.24.0" "User Commands" +.TH IGZIP "1" "December 2018" "igzip command line interface 2.24.0" "User Commands" .SH NAME igzip \- compress or decompress files similar to gzip .SH SYNOPSIS diff --git a/programs/igzip_cli.c b/programs/igzip_cli.c index e0efbdb..57d5cfd 100644 --- a/programs/igzip_cli.c +++ b/programs/igzip_cli.c @@ -616,7 +616,7 @@ int decompress_file(void) } isal_inflate_init(&state); - state.crc_flag = IGZIP_GZIP_NO_HDR; + state.crc_flag = ISAL_GZIP_NO_HDR_VER; state.next_in = inbuf; state.avail_in = fread_safe(state.next_in, 1, inbuf_size, in, infile_name); diff --git a/programs/igzip_cli_check.sh b/programs/igzip_cli_check.sh index 4912ab7..b78b57a 100755 --- a/programs/igzip_cli_check.sh +++ b/programs/igzip_cli_check.sh @@ -211,6 +211,8 @@ $IGZIP $file1 -o $file1$ds || ret=1 $IGZIP -t $file1$ds || ret=1 $IGZIP -t $file2 &> /dev/null && ret=1 cp $file1$ds $file2 && $IGZIP -t $file1$ds || ret=1 +truncate -s -1 $file1$ds +$IGZIP -t $file1$ds &> /dev/null && ret=1 pass_check $ret "Test test" clear_dir