mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-18 09:13:17 +00:00
Don't verify SSH host if the preference path is not set
This commit is contained in:
@@ -77,7 +77,9 @@ func (storage *RateLimitedStorage) SetRateLimits(downloadRateLimit int, uploadRa
|
|||||||
|
|
||||||
func checkHostKey(hostname string, remote net.Addr, key ssh.PublicKey) error {
|
func checkHostKey(hostname string, remote net.Addr, key ssh.PublicKey) error {
|
||||||
|
|
||||||
preferencePath := GetDuplicacyPreferencePath()
|
if preferencePath == "" {
|
||||||
|
return fmt.Errorf("Can't verify SSH host since the preference path is not set")
|
||||||
|
}
|
||||||
hostFile := path.Join(preferencePath, "known_hosts")
|
hostFile := path.Join(preferencePath, "known_hosts")
|
||||||
file, err := os.OpenFile(hostFile, os.O_RDWR|os.O_CREATE, 0600)
|
file, err := os.OpenFile(hostFile, os.O_RDWR|os.O_CREATE, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user