You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-09-16 09:06:18 +02:00
Revert "Forbid % character in parameters."
The issue "fixed" inf01aa586
was caused by treating all strings as format strings while logging, which was fixed in0c05df45
. Revert because there no longer seems a reason for the extra logic, and it was only partially applied, i.e. not to env vars, command-line options, or config options.
This commit is contained in:
@@ -485,14 +485,6 @@ configParse(unsigned int argListSize, const char *argList[], bool resetLogLevel)
|
||||
if (commandParamList == NULL)
|
||||
commandParamList = strLstNew();
|
||||
|
||||
// Forbid parameters that contain % since they cause chaos downstream. Even printing % seems to cause
|
||||
// problems in the shell so spell it out instead.
|
||||
if (strchr(argList[optind - 1], '%') != NULL)
|
||||
{
|
||||
THROW_FMT(
|
||||
ParamInvalidError, "invalid percent character in parameter %u", strLstSize(commandParamList) + 1);
|
||||
}
|
||||
|
||||
strLstAdd(commandParamList, STR(argList[optind - 1]));
|
||||
}
|
||||
|
||||
|
@@ -634,15 +634,6 @@ testRun(void)
|
||||
TEST_ERROR(
|
||||
configParse(strLstSize(argList), strLstPtr(argList), false), ParamInvalidError, "command does not allow parameters");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
|
||||
strLstAdd(argList, CFGCMD_ARCHIVE_PUSH_STR);
|
||||
strLstAdd(argList, strNew("%p"));
|
||||
TEST_ERROR(
|
||||
configParse(strLstSize(argList), strLstPtr(argList), false), ParamInvalidError,
|
||||
"invalid percent character in parameter 1");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
argList = strLstNew();
|
||||
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
|
||||
|
Reference in New Issue
Block a user