1
0
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" in f01aa586 was caused by treating all strings as format strings while logging, which was fixed in 0c05df45.

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:
David Steele
2019-11-22 15:18:56 -05:00
parent 381aecae4e
commit 52a3ba6b6f
2 changed files with 0 additions and 17 deletions

View File

@@ -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]));
}

View File

@@ -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));