[Pkg-libvirt-maintainers] Bug#977728: /usr/bin/virsh: Please pass XDG_* environment variables to the SSH binary
Guilhem Moulin
guilhem at debian.org
Sat Dec 19 17:40:26 GMT 2020
Package: libvirt-clients
Version: 6.9.0-1+b2
Severity: wishlist
File: /usr/bin/virsh
Tags: patch upstream
Dear Maintainer,
Since version 8.4 OpenSSH supports environment variables in several
configuration values [0], thereby allowing using $XDG_RUNTIME_DIR as
ControlPath directory without having to hardcode its value in
~/.ssh/config:
ControlPath ${XDG_RUNTIME_DIR}/ssh-%C
However the above snippet causes the command to fail as virsh runs it in
a sanitized environment:
error: failed to connect to the hypervisor
error: Cannot recv data: vdollar_percent_expand: env var ${XDG_RUNTIME_DIR} has no value
invalid environment variable expansion: Connection reset by peer
This patch preserves environment variables of the XDG Base Directory
Specification [1] when calling the SSH binary. (Other XDG_* environment
variables are arguably useful as well for ProxyCommand.)
Alternatively, maybe a configuration option to run the SSH binary in the
stock environment would do? After all OpenSSH has its own environment
sanitation logic.
Thanks,
cheers,
--
Guilhem.
[0] https://www.openssh.com/txt/release-8.4 https://bugzilla.mindrot.org/show_bug.cgi?id=3140
[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 5.9.0-3-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages libvirt-clients depends on:
ii libc6 2.31-6
ii libgcc-s1 10.2.1-1
ii libglib2.0-0 2.66.4-1
ii libreadline8 8.1-1
ii libvirt0 6.9.0-1+b2
ii libxml2 2.9.10+dfsg-6.3+b1
ii sensible-utils 0.0.12+nmu1
libvirt-clients recommends no packages.
Versions of packages libvirt-clients suggests:
ii libvirt-daemon 6.9.0-1+b2
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Pass-XDG_-environment-variables-to-the-SSH-binary.patch
Type: text/x-diff
Size: 1778 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-libvirt-maintainers/attachments/20201219/5707f991/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-libvirt-maintainers/attachments/20201219/5707f991/attachment.sig>
More information about the Pkg-libvirt-maintainers
mailing list