mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
xz: Add --ignore-check.
This commit is contained in:
parent
9adbc2ff37
commit
6b5e3b9eff
5 changed files with 38 additions and 1 deletions
|
@ -22,6 +22,7 @@ bool opt_stdout = false;
|
||||||
bool opt_force = false;
|
bool opt_force = false;
|
||||||
bool opt_keep_original = false;
|
bool opt_keep_original = false;
|
||||||
bool opt_robot = false;
|
bool opt_robot = false;
|
||||||
|
bool opt_ignore_check = false;
|
||||||
|
|
||||||
// We don't modify or free() this, but we need to assign it in some
|
// We don't modify or free() this, but we need to assign it in some
|
||||||
// non-const pointers.
|
// non-const pointers.
|
||||||
|
@ -141,6 +142,7 @@ parse_real(args_info *args, int argc, char **argv)
|
||||||
OPT_INFO_MEMORY,
|
OPT_INFO_MEMORY,
|
||||||
OPT_ROBOT,
|
OPT_ROBOT,
|
||||||
OPT_FLUSH_TIMEOUT,
|
OPT_FLUSH_TIMEOUT,
|
||||||
|
OPT_IGNORE_CHECK,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char short_opts[]
|
static const char short_opts[]
|
||||||
|
@ -169,6 +171,7 @@ parse_real(args_info *args, int argc, char **argv)
|
||||||
// Basic compression settings
|
// Basic compression settings
|
||||||
{ "format", required_argument, NULL, 'F' },
|
{ "format", required_argument, NULL, 'F' },
|
||||||
{ "check", required_argument, NULL, 'C' },
|
{ "check", required_argument, NULL, 'C' },
|
||||||
|
{ "ignore-check", no_argument, NULL, OPT_IGNORE_CHECK },
|
||||||
{ "block-size", required_argument, NULL, OPT_BLOCK_SIZE },
|
{ "block-size", required_argument, NULL, OPT_BLOCK_SIZE },
|
||||||
{ "block-list", required_argument, NULL, OPT_BLOCK_LIST },
|
{ "block-list", required_argument, NULL, OPT_BLOCK_LIST },
|
||||||
{ "memlimit-compress", required_argument, NULL, OPT_MEM_COMPRESS },
|
{ "memlimit-compress", required_argument, NULL, OPT_MEM_COMPRESS },
|
||||||
|
@ -438,6 +441,10 @@ parse_real(args_info *args, int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case OPT_IGNORE_CHECK:
|
||||||
|
opt_ignore_check = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case OPT_BLOCK_SIZE:
|
case OPT_BLOCK_SIZE:
|
||||||
opt_block_size = str_to_uint64("block-size", optarg,
|
opt_block_size = str_to_uint64("block-size", optarg,
|
||||||
0, LZMA_VLI_MAX);
|
0, LZMA_VLI_MAX);
|
||||||
|
|
|
@ -36,6 +36,7 @@ extern bool opt_force;
|
||||||
extern bool opt_keep_original;
|
extern bool opt_keep_original;
|
||||||
// extern bool opt_recursive;
|
// extern bool opt_recursive;
|
||||||
extern bool opt_robot;
|
extern bool opt_robot;
|
||||||
|
extern bool opt_ignore_check;
|
||||||
|
|
||||||
extern const char stdin_filename[];
|
extern const char stdin_filename[];
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,15 @@ coder_init(file_pair *pair)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK;
|
uint32_t flags = 0;
|
||||||
|
|
||||||
|
// It seems silly to warn about unsupported check if the
|
||||||
|
// check won't be verified anyway due to --ignore-check.
|
||||||
|
if (opt_ignore_check)
|
||||||
|
flags |= LZMA_IGNORE_CHECK;
|
||||||
|
else
|
||||||
|
flags |= LZMA_TELL_UNSUPPORTED_CHECK;
|
||||||
|
|
||||||
if (!opt_single_stream)
|
if (!opt_single_stream)
|
||||||
flags |= LZMA_CONCATENATED;
|
flags |= LZMA_CONCATENATED;
|
||||||
|
|
||||||
|
|
|
@ -1122,6 +1122,8 @@ message_help(bool long_help)
|
||||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||||
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
|
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
|
||||||
" `crc32', `crc64' (default), or `sha256'"));
|
" `crc32', `crc64' (default), or `sha256'"));
|
||||||
|
puts(_(
|
||||||
|
" --ignore-check don't verify the integrity check when decompressing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
puts(_(
|
puts(_(
|
||||||
|
|
19
src/xz/xz.1
19
src/xz/xz.1
|
@ -609,6 +609,25 @@ Integrity of the
|
||||||
headers is always verified with CRC32.
|
headers is always verified with CRC32.
|
||||||
It is not possible to change or disable it.
|
It is not possible to change or disable it.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-ignore\-check
|
||||||
|
Don't verify the integrity check of the compressed data when decompressing.
|
||||||
|
The CRC32 values in the
|
||||||
|
.B .xz
|
||||||
|
headers will still be verified normally.
|
||||||
|
.IP ""
|
||||||
|
.B "Do not use this option unless you know what you are doing."
|
||||||
|
Possible reasons to use this option:
|
||||||
|
.RS
|
||||||
|
.IP \(bu 3
|
||||||
|
Trying to recover data from a corrupt .xz file.
|
||||||
|
.IP \(bu 3
|
||||||
|
Speeding up decompression.
|
||||||
|
This matters mostly with SHA-256 or
|
||||||
|
with files that have compressed extremely well.
|
||||||
|
It's recommended to not use this option for this purpose
|
||||||
|
unless the file integrity is verified externally in some other way.
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
.BR \-0 " ... " \-9
|
.BR \-0 " ... " \-9
|
||||||
Select a compression preset level.
|
Select a compression preset level.
|
||||||
The default is
|
The default is
|
||||||
|
|
Loading…
Reference in a new issue