Skip to content

Commit

Permalink
pkg/ssh: fix windows path logic
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 512cfbd)
  • Loading branch information
Luap99 committed Dec 9, 2024
1 parent a76e706 commit aefab14
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/ssh/connection_golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"net/url"
"os"
"os/user"
"path"
"path/filepath"
"regexp"
"strings"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aefab14

Please sign in to comment.