After 0.8.0 release, libssh deprecated ssh_is_server_known() method to
introduce ssh_session_is_known_server(). This commit check if
ssh_session_is_known_server() is available to use. If it is not, it creates
an alias to ssh_is_server_known() during the configuration.
The commits are similar to c9da6cbe and 463fa9c7.
Julio Faracco (2):
rpc: replacing ssh_is_server_known() by ssh_session_is_known_server().
m4: checking if ssh_session_is_known_server() exists.
m4/virt-libssh.m4 | 4 ++++
src/rpc/virnetlibsshsession.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
--
2.19.1
Show replies by date
After version 0.8.0, libssh deprecated the function scope
ssh_is_server_known() and moved to ssh_session_is_known_server(). So,
libvirt is failing to compile using this new function name.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/rpc/virnetlibsshsession.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index 7c5f158f4d..286c66091d 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -287,7 +287,7 @@ virNetLibsshCheckHostKey(virNetLibsshSessionPtr sess)
if (sess->hostKeyVerify == VIR_NET_LIBSSH_HOSTKEY_VERIFY_IGNORE)
return 0;
- state = ssh_is_server_known(sess->session);
+ state = ssh_session_is_known_server(sess->session);
switch (state) {
case SSH_SERVER_KNOWN_OK:
--
2.19.1
This commit adds some checks inside libssh m4 checking to verify if
ssh_session_is_known_server function is available. This new function
scope replaces the old ssh_is_server_known() from libssh 0.8.0 and
below versions.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
m4/virt-libssh.m4 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/m4/virt-libssh.m4 b/m4/virt-libssh.m4
index 01c3b75c72..64d7b75b65 100644
--- a/m4/virt-libssh.m4
+++ b/m4/virt-libssh.m4
@@ -33,6 +33,10 @@ AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[
[],
[AC_DEFINE_UNQUOTED([ssh_get_server_publickey], [ssh_get_publickey],
[ssh_get_publickey is deprecated and replaced by
ssh_get_server_publickey.])])
+ AC_CHECK_FUNC([ssh_session_is_known_server],
+ [],
+ [AC_DEFINE_UNQUOTED([ssh_session_is_known_server], [ssh_is_server_known],
+ [ssh_is_server_known is deprecated and replaced by
ssh_session_is_known_server.])])
CFLAGS="$old_CFLAGS"
LIBS="$old_LIBS"
fi
--
2.19.1
This fix has a problem partially.
The official documentation says to use ssh_session_is_known_server() now.
But the function return has changed too.
Now, it is using "enum ssh_known_hosts_e" instead of "enum
ssh_server_know_e".
Some enums matches, but others don't.
Error was -1 and now it is -2 (following libssh example).
I would suggest to create an aux way to identify the return/state.
Or even use integers instead enums.
Anyone has a better idea? Obviously, with less impact and portable...
--
Julio Cesar Faracco