pgbackrest.git / summary / log / commit / refs

commit    88c1929ec5a41915753e3d3078bdaae62d14bf0f
Author:   David Steele <david@pgmasters.net>
Date:     Fri Jul 26 12:37:58 2019 +0000

    Don't pass local config* options to the remote.
    
    The remotes have their own config options (repo-host-config, etc.) so don't pass the local config* options.
    
    This was a regression from the behavior of the Perl code and while there have been no field reports it caused breakage on test systems with multiple configurations.


src/protocol/helper.c | 13 +++++++------ test/src/module/protocol/protocolTest.c | 6 ++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/protocol/helper.c b/src/protocol/helper.c index c4f564346..e9e27ddfc 100644 --- a/src/protocol/helper.c +++ b/src/protocol/helper.c @@ -235,18 +235,19 @@ protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int protoc // Replace config options with the host versions unsigned int optConfig = isRepo ? cfgOptRepoHostConfig : cfgOptPgHostConfig + hostIdx; - if (cfgOptionSource(optConfig) != cfgSourceDefault) - kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_STR), cfgOption(optConfig)); + kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_STR), cfgOptionSource(optConfig) != cfgSourceDefault ? cfgOption(optConfig) : NULL); unsigned int optConfigIncludePath = isRepo ? cfgOptRepoHostConfigIncludePath : cfgOptPgHostConfigIncludePath + hostIdx; - if (cfgOptionSource(optConfigIncludePath) != cfgSourceDefault) - kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_INCLUDE_PATH_STR), cfgOption(optConfigIncludePath)); + kvPut( + optionReplace, VARSTR(CFGOPT_CONFIG_INCLUDE_PATH_STR), + cfgOptionSource(optConfigIncludePath) != cfgSourceDefault ? cfgOption(optConfigIncludePath) : NULL); unsigned int optConfigPath = isRepo ? cfgOptRepoHostConfigPath : cfgOptPgHostConfigPath + hostIdx; - if (cfgOptionSource(optConfigPath) != cfgSourceDefault) - kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_PATH_STR), cfgOption(optConfigPath)); + kvPut( + optionReplace, VARSTR(CFGOPT_CONFIG_PATH_STR), + cfgOptionSource(optConfigPath) != cfgSourceDefault ? cfgOption(optConfigPath) : NULL); // Use a C remote kvPut(optionReplace, VARSTR(CFGOPT_C_STR), VARBOOL(true)); diff --git a/test/src/module/protocol/protocolTest.c b/test/src/module/protocol/protocolTest.c index 1c394f2b4..c6dee0bda 100644 --- a/test/src/module/protocol/protocolTest.c +++ b/test/src/module/protocol/protocolTest.c @@ -150,11 +150,17 @@ testRun(void) // ***************************************************************************************************************************** if (testBegin("protocolRemoteParam()")) { + storagePutNP(storageNewWriteNP(storageTest, strNew("pgbackrest.conf")), bufNew(0)); + StringList *argList = strLstNew(); strLstAddZ(argList, "pgbackrest"); strLstAddZ(argList, "--stanza=test1"); strLstAddZ(argList, "--repo1-host=repo-host"); strLstAddZ(argList, "--repo1-host-user=repo-host-user"); + // Local config settings should never be passed to the remote + strLstAdd(argList, strNewFmt("--config=%s/pgbackrest.conf", testPath())); + strLstAdd(argList, strNewFmt("--config-include-path=%s", testPath())); + strLstAdd(argList, strNewFmt("--config-path=%s", testPath())); strLstAddZ(argList, "archive-get"); harnessCfgLoad(strLstSize(argList), strLstPtr(argList)); [parent: f8b0676fd6ed]