mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
connection: ignore errors when parsing ssh_config
The new ssh_Config feature doesn't work on my system because the lib fails to parse configs using Match[1]. However Fedora and RHEL based distros seem to ship /etc/ssh/ssh_config.d/50-redhat.conf which contains a Match line thus it always fails to parse and never uses the proper values from my home dir config. [1] https://github.com/kevinburke/ssh_config/issues/6 Signed-off-by: Paul Holzinger <pholzing@redhat.com> (cherry picked from commit 8a5ec2c505392588827d9dad847fd797578d0ffb)
This commit is contained in:
@ -170,6 +170,7 @@ func sshClient(_url *url.URL, uri string, identity string, machine bool) (Connec
|
|||||||
// ssh_config
|
// ssh_config
|
||||||
alias := _url.Hostname()
|
alias := _url.Hostname()
|
||||||
cfg := ssh_config.DefaultUserSettings
|
cfg := ssh_config.DefaultUserSettings
|
||||||
|
cfg.IgnoreErrors = true
|
||||||
found := false
|
found := false
|
||||||
if val := cfg.Get(alias, "User"); val != "" {
|
if val := cfg.Get(alias, "User"); val != "" {
|
||||||
userinfo = url.User(val)
|
userinfo = url.User(val)
|
||||||
|
Reference in New Issue
Block a user