[libvirt] [PATCH 2/2] Fix handling keyboard-interactive callbacks for libssh2

Michal Privoznik mprivozn at redhat.com
Wed Oct 29 04:20:55 UTC 2014


On 24.10.2014 07:15, Cédric Bosdonnat wrote:
> SSHD calls the KI callback with no prompt after all prompts have been
> issued. Just ignore those callbacks to avoid libvirt-java (and possibly
> others) to crash while accessing invalid pointers.
> ---
>   src/rpc/virnetsshsession.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
> index 57119f9..e9516b8 100644
> --- a/src/rpc/virnetsshsession.c
> +++ b/src/rpc/virnetsshsession.c
> @@ -217,6 +217,10 @@ virNetSSHKbIntCb(const char *name ATTRIBUTE_UNUSED,
>
>       priv->authCbErr = VIR_NET_SSH_AUTHCB_OK;
>
> +    /* After all prompts, sshd calls us with 0 prompts: just ignore it */
> +    if (num_prompts == 0)
> +        return;
> +
>       /* find credential type for asking passwords */
>       for (i = 0; i < priv->cred->ncredtype; i++) {
>           if (priv->cred->credtype[i] == VIR_CRED_PASSPHRASE ||
>

ACK

Michal




More information about the libvir-list mailing list