You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-09-16 09:06:18 +02:00
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.
This commit is contained in:
@@ -235,18 +235,19 @@ protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int protoc
|
|||||||
// Replace config options with the host versions
|
// Replace config options with the host versions
|
||||||
unsigned int optConfig = isRepo ? cfgOptRepoHostConfig : cfgOptPgHostConfig + hostIdx;
|
unsigned int optConfig = isRepo ? cfgOptRepoHostConfig : cfgOptPgHostConfig + hostIdx;
|
||||||
|
|
||||||
if (cfgOptionSource(optConfig) != cfgSourceDefault)
|
kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_STR), cfgOptionSource(optConfig) != cfgSourceDefault ? cfgOption(optConfig) : NULL);
|
||||||
kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_STR), cfgOption(optConfig));
|
|
||||||
|
|
||||||
unsigned int optConfigIncludePath = isRepo ? cfgOptRepoHostConfigIncludePath : cfgOptPgHostConfigIncludePath + hostIdx;
|
unsigned int optConfigIncludePath = isRepo ? cfgOptRepoHostConfigIncludePath : cfgOptPgHostConfigIncludePath + hostIdx;
|
||||||
|
|
||||||
if (cfgOptionSource(optConfigIncludePath) != cfgSourceDefault)
|
kvPut(
|
||||||
kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_INCLUDE_PATH_STR), cfgOption(optConfigIncludePath));
|
optionReplace, VARSTR(CFGOPT_CONFIG_INCLUDE_PATH_STR),
|
||||||
|
cfgOptionSource(optConfigIncludePath) != cfgSourceDefault ? cfgOption(optConfigIncludePath) : NULL);
|
||||||
|
|
||||||
unsigned int optConfigPath = isRepo ? cfgOptRepoHostConfigPath : cfgOptPgHostConfigPath + hostIdx;
|
unsigned int optConfigPath = isRepo ? cfgOptRepoHostConfigPath : cfgOptPgHostConfigPath + hostIdx;
|
||||||
|
|
||||||
if (cfgOptionSource(optConfigPath) != cfgSourceDefault)
|
kvPut(
|
||||||
kvPut(optionReplace, VARSTR(CFGOPT_CONFIG_PATH_STR), cfgOption(optConfigPath));
|
optionReplace, VARSTR(CFGOPT_CONFIG_PATH_STR),
|
||||||
|
cfgOptionSource(optConfigPath) != cfgSourceDefault ? cfgOption(optConfigPath) : NULL);
|
||||||
|
|
||||||
// Use a C remote
|
// Use a C remote
|
||||||
kvPut(optionReplace, VARSTR(CFGOPT_C_STR), VARBOOL(true));
|
kvPut(optionReplace, VARSTR(CFGOPT_C_STR), VARBOOL(true));
|
||||||
|
@@ -150,11 +150,17 @@ testRun(void)
|
|||||||
// *****************************************************************************************************************************
|
// *****************************************************************************************************************************
|
||||||
if (testBegin("protocolRemoteParam()"))
|
if (testBegin("protocolRemoteParam()"))
|
||||||
{
|
{
|
||||||
|
storagePutNP(storageNewWriteNP(storageTest, strNew("pgbackrest.conf")), bufNew(0));
|
||||||
|
|
||||||
StringList *argList = strLstNew();
|
StringList *argList = strLstNew();
|
||||||
strLstAddZ(argList, "pgbackrest");
|
strLstAddZ(argList, "pgbackrest");
|
||||||
strLstAddZ(argList, "--stanza=test1");
|
strLstAddZ(argList, "--stanza=test1");
|
||||||
strLstAddZ(argList, "--repo1-host=repo-host");
|
strLstAddZ(argList, "--repo1-host=repo-host");
|
||||||
strLstAddZ(argList, "--repo1-host-user=repo-host-user");
|
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");
|
strLstAddZ(argList, "archive-get");
|
||||||
harnessCfgLoad(strLstSize(argList), strLstPtr(argList));
|
harnessCfgLoad(strLstSize(argList), strLstPtr(argList));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user