From aefab141f3270418ebb49f1159a4d1b3739551bc Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 26 Nov 2024 14:51:47 +0100 Subject: [PATCH] pkg/ssh: fix windows path logic Using the path package is not correct on windows as it always defaults to the "/" as path separator. Instead one must use the filepath package. Fixes containers/podman#24616 Signed-off-by: Paul Holzinger (cherry picked from commit 512cfbd46fc0001e8053332960760a77b191d5a2) --- pkg/ssh/connection_golang.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/ssh/connection_golang.go b/pkg/ssh/connection_golang.go index c2b1265c3..0439354c4 100644 --- a/pkg/ssh/connection_golang.go +++ b/pkg/ssh/connection_golang.go @@ -10,7 +10,6 @@ import ( "net/url" "os" "os/user" - "path" "path/filepath" "regexp" "strings" @@ -313,7 +312,7 @@ func ValidateAndConfigure(uri *url.URL, iden string, insecureIsMachineConnection if !errors.Is(err, os.ErrNotExist) { return nil, err } - keyDir := path.Dir(keyFilePath) + keyDir := filepath.Dir(keyFilePath) if err := fileutils.Exists(keyDir); errors.Is(err, os.ErrNotExist) { if err := os.Mkdir(keyDir, 0o700); err != nil { return nil, err