diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-11 21:47:56 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-11 21:47:56 -0700 |
| commit | fca731c5d26658d6813d0d33bc5d55f93ea464b1 (patch) | |
| tree | c9e2e110d99b55cf9673cdd1cd71c277c41fce72 /internal/wfs/sftpfs | |
| parent | 3dc1c5254b27d39fdeff87a788951dfe83c48541 (diff) | |
| download | ccp-fca731c5d26658d6813d0d33bc5d55f93ea464b1.tar.zst | |
Fix a few path.Join to filepath.Join for local paths
Not that this would work on Windows anyway
Diffstat (limited to 'internal/wfs/sftpfs')
| -rw-r--r-- | internal/wfs/sftpfs/sftpfs.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/wfs/sftpfs/sftpfs.go b/internal/wfs/sftpfs/sftpfs.go index 2ec9635..b02ed8c 100644 --- a/internal/wfs/sftpfs/sftpfs.go +++ b/internal/wfs/sftpfs/sftpfs.go @@ -8,7 +8,6 @@ import ( "io/fs" "net" "os" - "path" "path/filepath" "strings" "sync" @@ -120,7 +119,7 @@ func sshKeys() ([]ssh.Signer, error) { } func appendToKnownHosts(hostname string, key ssh.PublicKey) error { - f, err := os.OpenFile(path.Join(os.Getenv("HOME"), ".ssh/known_hosts"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600) + f, err := os.OpenFile(filepath.Join(os.Getenv("HOME"), ".ssh/known_hosts"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600) if err != nil { return err } @@ -133,7 +132,7 @@ func appendToKnownHosts(hostname string, key ssh.PublicKey) error { // Dial establishes a new SFTP connection to the given host. func Dial(target string) (*FS, error) { - knownHostChecker, err := knownhosts.New(path.Join(os.Getenv("HOME"), ".ssh/known_hosts")) + knownHostChecker, err := knownhosts.New(filepath.Join(os.Getenv("HOME"), ".ssh/known_hosts")) if err != nil { knownHostChecker = func(string, net.Addr, ssh.PublicKey) error { return &knownhosts.KeyError{} } } |
