[PATCH] virnetsshsession: Adapt to changed libssh2 API

Peter Krempa pkrempa at redhat.com
Mon Jun 5 12:59:37 UTC 2023


On Mon, Jun 05, 2023 at 14:43:31 +0200, Michal Privoznik wrote:
> In one of its commits [1] libssh2 changed the 'text' member of
> LIBSSH2_USERAUTH_KBDINT_PROMPT struct from 'char' to 'unsigned
> char'. But we g_strdup() the member in order to fill 'prompt'
> member of virConnectCredential struct. Typecast the value to
> avoid warnings. Also, drop @prompt variable, as it's needless.
> 
> 1: https://github.com/libssh2/libssh2/commit/83853f8aea0e2f739cacd491632eb7fd3d03ad2d
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> 
> Here's a somewhat green CI:
> 
> https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/889599454
> 
> I mean, we still have failures on rawhide, but that's because numad was
> temporarily removed from repos, but they are bringing it back. So ignore
> that part. Apparently our CI images were not rebuilt this morning.

No, because rawhide update exploded as it sometimes does:

#4 31.09 Error: Unable to find a match: numad

> 
>  src/rpc/virnetsshsession.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
> index f84805825b..1df43bb044 100644
> --- a/src/rpc/virnetsshsession.c
> +++ b/src/rpc/virnetsshsession.c
> @@ -216,9 +216,7 @@ virNetSSHKbIntCb(const char *name G_GNUC_UNUSED,
>  
>      /* fill data structures for auth callback */
>      for (i = 0; i < num_prompts; i++) {
> -        char *prompt;
> -        prompt = g_strdup(prompts[i].text);
> -        askcred[i].prompt = prompt;
> +        askcred[i].prompt = g_strdup((char*)prompts[i].text);
>  
>          /* remove colon and trailing spaces from prompts, as default behavior
>           * of libvirt's auth callback is to add them */

Reviewed-by: Peter Krempa <pkrempa at redhat.com>


More information about the libvir-list mailing list