1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-10 13:23:17 +00:00

Storage name can't be 'ssh' otherwise the ssh password of the default storage nad the storage password of the 'ssh' storage will share the same keychain entry

This commit is contained in:
Gilbert Chen
2017-09-25 21:52:49 -04:00
parent 5031ae15d0
commit 8841ced1f5
2 changed files with 12 additions and 0 deletions

View File

@@ -223,6 +223,11 @@ func configRepository(context *cli.Context, init bool) {
storageName = context.Args()[0]
snapshotID = context.Args()[1]
storageURL = context.Args()[2]
if strings.ToLower(storageName) == "ssh" {
duplicacy.LOG_ERROR("PREFERENCE_INVALID", "'%s' is an invalid storage name", storageName)
return
}
}
var repository string

View File

@@ -74,6 +74,13 @@ func LoadPreferences(repository string) bool {
return false
}
for _, preference := range Preferences {
if strings.ToLower(preference.Name) == "ssh" {
LOG_ERROR("PREFERENCE_INVALID", "'%s' is an invalid storage name", preference.Name)
return false
}
}
return true
}