File 1b8c1ce7-adapt-libssh2-api.patch of Package libvirt.33143
commit 1b8c1ce704788c08a764183aca74f3043d7733e4
Author: Michal Prívozník <mprivozn@redhat.com>
Date: Mon Jun 5 14:24:48 2023 +0200
virnetsshsession: Adapt to changed libssh2 API
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@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Index: libvirt-7.1.0/src/rpc/virnetsshsession.c
===================================================================
--- libvirt-7.1.0.orig/src/rpc/virnetsshsession.c
+++ libvirt-7.1.0/src/rpc/virnetsshsession.c
@@ -226,9 +226,7 @@ virNetSSHKbIntCb(const char *name G_GNUC
/* 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 */