[Libvirt-ci] Passed: libvirt/libvirt#2715 (v5.8.0-rc1 - 76d3124)

Travis CI builds at travis-ci.org
Tue Oct 1 13:41:13 UTC 2019


Build Update for libvirt/libvirt
-------------------------------------

Build: #2715
Status: Passed

Duration: 25 mins and 55 secs
Commit: 76d3124 (v5.8.0-rc1)
Author: Daniel P. Berrangé
Message: rpc: fix escaping of shell path for netcat binary

Consider having a nc binary in the path with a space in its name,
for example '/tmp/fo o/nc'

This results in libvirt running SSH with the following arg value

  "'if ''/tmp/fo o/nc'' -q 2>&1 | grep \"requires
    an argument\" >/dev/null 2>&1; then ARG=-q0;
    else ARG=;fi;''/tmp/fo o/nc'' $ARG -U
    /var/run/libvirt/libvirt-sock'"

The use of the single quote escaping was introduced by

  commit 6ac6238de33fc74e7545b245ae273d1bfd658808
  Author: Guido Günther <agx at sigxcpu.org>
  Date:   Thu Oct 13 21:49:01 2011 +0200

    Use virBufferEscapeShell in virNetSocketNewConnectSSH

    to escape the netcat command since it's passed to the shell. Adjust
    expected test case output accordingly.

While the intention of this change was good, the result is broken as it
is still underquoted.

On the SSH server side, SSH itself runs the command via the shell.
Our command is then invoking the shell again. Thus we see

$ virsh -c qemu+ssh://root@domokun/system?netcat=%2Ftmp%2Ffo%20o%2Fnc list
error: failed to connect to the hypervisor
error: End of file while reading data: sh: /tmp/fo: No such file or directory: Input/output error

With the second level of escaping added we can now successfully use a nc
binary with a space in the path.

The original test case added was misleading as it illustrated using a
binary path of 'nc -4' which is not a path, it is a command with a
separate argument, which is getting interpreted as a path.

Reviewed-by: Eric Blake <eblake at redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>

View the changeset: https://github.com/libvirt/libvirt/compare/v5.8.0-rc1

View the full build log and details: https://travis-ci.org/libvirt/libvirt/builds/592017744?utm_medium=notification&utm_source=email

--

You can unsubscribe from build emails from the libvirt/libvirt repository going to https://travis-ci.org/account/preferences/unsubscribe?repository=4872032&utm_medium=notification&utm_source=email.
Or unsubscribe from *all* email updating your settings at https://travis-ci.org/account/preferences/unsubscribe?utm_medium=notification&utm_source=email.
Or configure specific recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-ci/attachments/20191001/88ded1a7/attachment.htm>


More information about the Libvirt-ci mailing list