From 52a3ba6b6f25443b5ed456969b794f63a809a606 Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 22 Nov 2019 15:18:56 -0500 Subject: [PATCH] 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. --- src/config/parse.c | 8 -------- test/src/module/config/parseTest.c | 9 --------- 2 files changed, 17 deletions(-) diff --git a/src/config/parse.c b/src/config/parse.c index 649987589..6736cb962 100644 --- a/src/config/parse.c +++ b/src/config/parse.c @@ -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])); } diff --git a/test/src/module/config/parseTest.c b/test/src/module/config/parseTest.c index 60a7e8197..d91d788dc 100644 --- a/test/src/module/config/parseTest.c +++ b/test/src/module/config/parseTest.c @@ -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));