1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-18 01:03:25 +00:00

Don't save passwords from env/pref to keyring

This commit is contained in:
Gilbert Chen
2017-09-08 16:51:05 -04:00
parent 68fb6d671e
commit 3f83890859
2 changed files with 22 additions and 4 deletions

View File

@@ -199,7 +199,9 @@ func CreateStorage(preference Preference, resetPassword bool, threads int) (stor
if username != "" {
username = username[:len(username) - 1]
}
keyFile := GetPasswordFromPreference(preference, "ssh_key_file")
// If ssh_key_file is set, skip password-based login
keyFile := GetPasswordFromPreference(preference, "ssh_key_file")
password := ""
passwordCallback := func() (string, error) {
@@ -281,10 +283,10 @@ func CreateStorage(preference Preference, resetPassword bool, threads int) (stor
keyFileAuthMethods := [] ssh.AuthMethod {
ssh.PublicKeysCallback(publicKeysCallback),
}
if keyFile!="" {
authMethods = append(keyFileAuthMethods,passwordAuthMethods...)
if keyFile != "" {
authMethods = append(keyFileAuthMethods, passwordAuthMethods...)
} else {
authMethods = append(passwordAuthMethods,keyFileAuthMethods...)
authMethods = append(passwordAuthMethods, keyFileAuthMethods...)
}
if RunInBackground {