]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: always pass "-T -e none" args to ssh
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 9 Jul 2019 17:02:38 +0000 (18:02 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 11 Jul 2019 14:26:54 +0000 (15:26 +0100)
commit1939bcd539dea488567f7eba3edc50adbd47d7c3
tree8f3a9c6d2122d48b21f6f72e942ff6b45b5723a7
parent173a191cfe5b99729c7a0b3e1e5878021e613496
rpc: always pass "-T -e none" args to ssh

Way back in the past, the "no_tty=1" option was added for the remote
driver to disable local password prompting by disabling use of the local
tty:

  commit b32f42984994a397441a1c48f1a002e906624c51
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Fri Sep 21 20:17:09 2007 +0000

    Added a no_tty param to remote URIs to stop SSH prompting for password

This was done by adding "-T -o BatchMode=yes -e none" args to ssh. This
achieved the desired results but is none the less semantically flawed
because it is mixing up config parameters for the local tty vs the
remote tty.

The "-T" arg stops allocation of a TTY on the remote host. This is good
for all libvirt SSH tunnels as we never require a TTY for our usage
model, so we should have just passed this unconditionally.

The "-e none" option disables the escape character for sessions with a
TTY. If we pass "-T" this is not required, but it also not harmful to
add it, so we should just pass it unconditionally too.

Only the "-o BatchMode=yes" option is related to disabling local
password prompts and thus needs control via the no_tty URI param.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/rpc/virnetsocket.c
tests/virnetsockettest.c