render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Pablo Greco 40546a
From aa46a438d03839963badb7bdd2904a71f0662942 Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <aa46a438d03839963badb7bdd2904a71f0662942@dist-git>
Pablo Greco 40546a
From: Pavel Hrdina <phrdina@redhat.com>
Pablo Greco 40546a
Date: Fri, 21 Jun 2019 09:30:36 +0200
Pablo Greco 40546a
Subject: [PATCH] rpc: virnetlibsshsession: update deprecated functions
Pablo Greco 40546a
Pablo Greco 40546a
In libssh 0.9.0 functions ssh_is_server_known and ssh_write_knownhost
Pablo Greco 40546a
are marked as deprecated.
Pablo Greco 40546a
Pablo Greco 40546a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1722735
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Pablo Greco 40546a
Message-Id: <e6b648f51b2d3a2714d7e28249dd390f707994b1.1561102197.git.phrdina@redhat.com>
Pablo Greco 40546a
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 m4/virt-libssh.m4             | 8 ++++++++
Pablo Greco 40546a
 src/rpc/virnetlibsshsession.c | 4 ++--
Pablo Greco 40546a
 2 files changed, 10 insertions(+), 2 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/m4/virt-libssh.m4 b/m4/virt-libssh.m4
Pablo Greco 40546a
index 01c3b75c72..132447da16 100644
Pablo Greco 40546a
--- a/m4/virt-libssh.m4
Pablo Greco 40546a
+++ b/m4/virt-libssh.m4
Pablo Greco 40546a
@@ -33,6 +33,14 @@ AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[
Pablo Greco 40546a
       [],
Pablo Greco 40546a
       [AC_DEFINE_UNQUOTED([ssh_get_server_publickey], [ssh_get_publickey],
Pablo Greco 40546a
             [ssh_get_publickey is deprecated and replaced by ssh_get_server_publickey.])])
Pablo Greco 40546a
+    AC_CHECK_FUNC([ssh_session_is_known_server],
Pablo Greco 40546a
+      [],
Pablo Greco 40546a
+      [AC_DEFINE_UNQUOTED([ssh_session_is_known_server], [ssh_is_server_known],
Pablo Greco 40546a
+            [ssh_is_server_known is deprecated and replaced by ssh_session_is_known_server.])])
Pablo Greco 40546a
+    AC_CHECK_FUNC([ssh_session_update_known_hosts],
Pablo Greco 40546a
+      [],
Pablo Greco 40546a
+      [AC_DEFINE_UNQUOTED([ssh_session_update_known_hosts], [ssh_write_knownhost],
Pablo Greco 40546a
+            [ssh_write_knownhost is deprecated and replaced by ssh_session_update_known_hosts.])])
Pablo Greco 40546a
     CFLAGS="$old_CFLAGS"
Pablo Greco 40546a
     LIBS="$old_LIBS"
Pablo Greco 40546a
   fi
Pablo Greco 40546a
diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
Pablo Greco 40546a
index df819f6169..7bc2bd33ee 100644
Pablo Greco 40546a
--- a/src/rpc/virnetlibsshsession.c
Pablo Greco 40546a
+++ b/src/rpc/virnetlibsshsession.c
Pablo Greco 40546a
@@ -287,7 +287,7 @@ virNetLibsshCheckHostKey(virNetLibsshSessionPtr sess)
Pablo Greco 40546a
     if (sess->hostKeyVerify == VIR_NET_LIBSSH_HOSTKEY_VERIFY_IGNORE)
Pablo Greco 40546a
         return 0;
Pablo Greco 40546a
 
Pablo Greco 40546a
-    state = ssh_is_server_known(sess->session);
Pablo Greco 40546a
+    state = ssh_session_is_known_server(sess->session);
Pablo Greco 40546a
 
Pablo Greco 40546a
     switch (state) {
Pablo Greco 40546a
     case SSH_SERVER_KNOWN_OK:
Pablo Greco 40546a
@@ -381,7 +381,7 @@ virNetLibsshCheckHostKey(virNetLibsshSessionPtr sess)
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* write the host key file, if specified */
Pablo Greco 40546a
         if (sess->knownHostsFile) {
Pablo Greco 40546a
-            if (ssh_write_knownhost(sess->session) < 0) {
Pablo Greco 40546a
+            if (ssh_session_update_known_hosts(sess->session) < 0) {
Pablo Greco 40546a
                 errmsg = ssh_get_error(sess->session);
Pablo Greco 40546a
                 virReportError(VIR_ERR_LIBSSH,
Pablo Greco 40546a
                                _("failed to write known_host file '%s': %s"),
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a