diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-04 15:38:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-04 15:38:08 -0500 |
commit | 07af857961a2d09990ef39e188ec7bb6fdf75147 (patch) | |
tree | 996175db480c4a0dc988f50de073cdf6a58fb8c3 /pkg | |
parent | c55b83195eeb774078e48febc03d4655a7fbed52 (diff) | |
parent | aaade40780406dd1de4907497d7e0301b053cbc5 (diff) | |
download | podman-07af857961a2d09990ef39e188ec7bb6fdf75147.tar.gz podman-07af857961a2d09990ef39e188ec7bb6fdf75147.tar.bz2 podman-07af857961a2d09990ef39e188ec7bb6fdf75147.zip |
Merge pull request #8596 from afbjorklund/password-callback
Use PasswordCallback instead of Password for ssh
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/bindings/connection.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index a5683796a..f2cb3147c 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -207,11 +207,11 @@ func sshClient(_url *url.URL, secure bool, passPhrase string, identity string) ( authMethods = append(authMethods, ssh.Password(pw)) } if len(authMethods) == 0 { - pass, err := terminal.ReadPassword("Login password:") - if err != nil { - return Connection{}, err + callback := func() (string, error) { + pass, err := terminal.ReadPassword("Login password:") + return string(pass), err } - authMethods = append(authMethods, ssh.Password(string(pass))) + authMethods = append(authMethods, ssh.PasswordCallback(callback)) } port := _url.Port() |