1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-29 08:21:11 +03:00

Add compress-level range checking for each compress-type.

The prior range checking was done based on the valid values for gz. While this worked it was a subset of what is available for lz4 and zst.

Allow the range to be specified for each compress-type. Adding this functionality to the parse module would be a better solution but that is a bigger project than this fix deserves, at least for now.
This commit is contained in:
David Steele
2022-12-27 20:05:08 +07:00
committed by GitHub
parent 34110cfa01
commit 44da314adb
17 changed files with 189 additions and 36 deletions

View File

@ -426,9 +426,8 @@ foreach my $strKey (sort(keys(%{$rhConfigDefine})))
$rhConfigDefine->{$strKey}{&CFGDEF_SECURE} = false;
}
# All int, size and time options must have an allow range
if (($rhConfigDefine->{$strKey}{&CFGDEF_TYPE} eq CFGDEF_TYPE_INTEGER ||
$rhConfigDefine->{$strKey}{&CFGDEF_TYPE} eq CFGDEF_TYPE_TIME ||
# All size and time options must have an allow range
if (($rhConfigDefine->{$strKey}{&CFGDEF_TYPE} eq CFGDEF_TYPE_TIME ||
$rhConfigDefine->{$strKey}{&CFGDEF_TYPE} eq CFGDEF_TYPE_SIZE) &&
!(defined($rhConfigDefine->{$strKey}{&CFGDEF_ALLOW_RANGE}) || defined($rhConfigDefine->{$strKey}{&CFGDEF_ALLOW_LIST})))
{