diff options
author | cdoern <cdoern@redhat.com> | 2022-01-26 23:40:42 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-02-03 15:02:39 -0500 |
commit | 6d747dca22c8a232273be468304d59c6fe802d5d (patch) | |
tree | a22893a97c5accda1086d38fd36b981fdd003b04 /cmd/podman/images/scp_utils.go | |
parent | e0cbcdc335618ba0d53ecae9cc81230c7cb464e3 (diff) | |
download | podman-6d747dca22c8a232273be468304d59c6fe802d5d.tar.gz podman-6d747dca22c8a232273be468304d59c6fe802d5d.tar.bz2 podman-6d747dca22c8a232273be468304d59c6fe802d5d.zip |
podman image scp syntax correction
[NO NEW TESTS NEEDED] image scp was reading the localhost syntax too loosely causing some errors with domains or hosts containing the word
localhost. Fixed that and added a few lines to make sure the pure localhost connections do not touch sshd
resolves #13021
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'cmd/podman/images/scp_utils.go')
-rw-r--r-- | cmd/podman/images/scp_utils.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/images/scp_utils.go b/cmd/podman/images/scp_utils.go index c488616c9..a85687a42 100644 --- a/cmd/podman/images/scp_utils.go +++ b/cmd/podman/images/scp_utils.go @@ -17,12 +17,13 @@ func parseImageSCPArg(arg string) (*entities.ImageScpOptions, []string, error) { cliConnections := []string{} switch { - case strings.Contains(arg, "@localhost"): // image transfer between users + case strings.Contains(arg, "@localhost::"): // image transfer between users location.User = strings.Split(arg, "@")[0] location, err = validateImagePortion(location, arg) if err != nil { return nil, nil, err } + cliConnections = append(cliConnections, arg) case strings.Contains(arg, "::"): location, err = validateImagePortion(location, arg) if err != nil { |