[libvirt] [PATCH] rpc: always pass "-T -e none" args to ssh
Andrea Bolognani
abologna at redhat.com
Wed Jul 10 13:42:26 UTC 2019
On Tue, 2019-07-09 at 18:15 +0100, Daniel P. Berrangé wrote:
> 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 at 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.
>
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
> src/rpc/virnetsocket.c | 4 ++--
> tests/virnetsockettest.c | 34 ++++++++++++++++++----------------
> 2 files changed, 20 insertions(+), 18 deletions(-)
Great commit message!
The change makes sense, and the ssh documentation confirms the
options you mention indeed mean what you claim they do :)
Reviewed-by: Andrea Bolognani <abologna at redhat.com>
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list