mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-03-05 15:05:48 +02:00
Skip local repository duplicate check for SFTP.
This check does not make sense for SFTP since the repository will never be local.
This commit is contained in:
parent
80c9b3001c
commit
04ef43d9ed
@ -13,6 +13,19 @@
|
||||
|
||||
<p>Fix permissions when <cmd>restore</cmd> run as root user.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<github-issue id="2418"/>
|
||||
<github-pull-request id="2421"/>
|
||||
|
||||
<release-item-contributor-list>
|
||||
<release-item-ideator id="anton.kurochkin"/>
|
||||
<release-item-contributor id="reid.thompson"/>
|
||||
<release-item-reviewer id="david.steele"/>
|
||||
</release-item-contributor-list>
|
||||
|
||||
<p>Skip local repository duplicate check for <proper>SFTP</proper>.</p>
|
||||
</release-item>
|
||||
</release-bug-list>
|
||||
|
||||
<release-improvement-list>
|
||||
|
@ -96,10 +96,9 @@ cfgLoadUpdateOption(void)
|
||||
{
|
||||
for (unsigned int optionIdx = 0; optionIdx < cfgOptionGroupIdxTotal(cfgOptGrpRepo); optionIdx++)
|
||||
{
|
||||
// If the repo is local and either posix, cifs or sftp
|
||||
// If the repo is local and either posix or cifs
|
||||
if (!cfgOptionIdxTest(cfgOptRepoHost, optionIdx) &&
|
||||
(cfgOptionIdxStrId(cfgOptRepoType, optionIdx) == STORAGE_POSIX_TYPE ||
|
||||
cfgOptionIdxStrId(cfgOptRepoType, optionIdx) == STORAGE_SFTP_TYPE ||
|
||||
cfgOptionIdxStrId(cfgOptRepoType, optionIdx) == STORAGE_CIFS_TYPE))
|
||||
{
|
||||
// Ensure a local repo does not have the same path as another local repo of the same type
|
||||
|
@ -118,27 +118,6 @@ testRun(void)
|
||||
"local repo1 and repo2 paths are both '/var/lib/pgbackrest' but must be different");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef HAVE_LIBSSH2
|
||||
TEST_TITLE("local default repo paths for sftp repo type must be different");
|
||||
|
||||
argList = strLstNew();
|
||||
hrnCfgArgRawZ(argList, cfgOptRepo, "2");
|
||||
hrnCfgArgKeyRawStrId(argList, cfgOptRepoType, 1, STORAGE_SFTP_TYPE);
|
||||
hrnCfgArgKeyRawStrId(argList, cfgOptRepoType, 2, STORAGE_SFTP_TYPE);
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpHostUser, 1, "user1");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpHostUser, 2, "user2");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpHost, 1, "host1");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpHost, 2, "host2");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpHostKeyHashType, 1, "sha1");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpHostKeyHashType, 2, "md5");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpPrivateKeyFile, 1, "/keyfile1");
|
||||
hrnCfgArgKeyRawZ(argList, cfgOptRepoSftpPrivateKeyFile, 2, "/keyfile2");
|
||||
TEST_ERROR(
|
||||
hrnCfgLoadP(cfgCmdInfo, argList), OptionInvalidValueError,
|
||||
"local repo1 and repo2 paths are both '/var/lib/pgbackrest' but must be different");
|
||||
#endif // HAVE_LIBSSH2
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("local repo paths same but types different");
|
||||
|
||||
argList = strLstNew();
|
||||
|
Loading…
x
Reference in New Issue
Block a user