mirror of https://gitee.com/openkylin/libvirt.git
virnetsocket: pass HOME and XDG_RUNTIME_DIR to ssh
openssh supports environment variable expansion in its ssh_config file[1]. These two environment variables can be used to expand paths for ssh sockets and other files. Ex. ``` Host * ControlMaster auto ControlPath ${XDG_RUNTIME_DIR}/ssh-%C.ctl IdentityAgent ${XDG_RUNTIME_DIR}/ssh-agent.socket ``` see also: [1] https://man7.org/linux/man-pages/man5/ssh_config.5.html#ENVIRONMENT_VARIABLES [2] https://gitlab.com/libvirt/libvirt/-/issues/232 Signed-off-by: Дамјан Георгиевски <gdamjan@gmail.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
dfa5713bc2
commit
3f8f52265f
|
@ -852,6 +852,7 @@ int virNetSocketNewConnectSSH(const char *nodename,
|
|||
|
||||
cmd = virCommandNew(binary ? binary : "ssh");
|
||||
virCommandAddEnvPassCommon(cmd);
|
||||
virCommandAddEnvPass(cmd, "XDG_RUNTIME_DIR");
|
||||
virCommandAddEnvPass(cmd, "KRB5CCNAME");
|
||||
virCommandAddEnvPass(cmd, "SSH_AUTH_SOCK");
|
||||
virCommandAddEnvPass(cmd, "SSH_ASKPASS");
|
||||
|
|
Loading…
Reference in New Issue