From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
The function does not exist on win32.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/rpc/virnetlibsshsession.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index e71a79d0fb..e94b0d7a2e 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -60,7 +60,9 @@ typedef enum {
VIR_NET_LIBSSH_AUTH_KEYBOARD_INTERACTIVE,
VIR_NET_LIBSSH_AUTH_PASSWORD,
VIR_NET_LIBSSH_AUTH_PRIVKEY,
- VIR_NET_LIBSSH_AUTH_AGENT
+#ifndef WIN32
+ VIR_NET_LIBSSH_AUTH_AGENT,
+#endif
} virNetLibsshAuthMethods;
@@ -698,6 +700,7 @@ virNetLibsshAuthenticate(virNetLibsshSession *sess)
/* try to authenticate using the keyboard interactive way */
ret = virNetLibsshAuthenticateKeyboardInteractive(sess, auth);
break;
+#ifndef WIN32
case VIR_NET_LIBSSH_AUTH_AGENT:
/* try to authenticate using ssh-agent */
ret = ssh_userauth_agent(sess->session, NULL);
@@ -708,6 +711,7 @@ virNetLibsshAuthenticate(virNetLibsshSession *sess)
errmsg);
}
break;
+#endif
case VIR_NET_LIBSSH_AUTH_PRIVKEY:
/* try to authenticate using the provided ssh key */
ret = virNetLibsshAuthenticatePrivkey(sess, auth);
@@ -861,8 +865,13 @@ virNetLibsshSessionAuthAddPasswordAuth(virNetLibsshSession *sess,
}
int
-virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSession *sess)
+virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSession *sess G_GNUC_UNUSED)
{
+#ifdef WIN32
+ virReportError(VIR_ERR_LIBSSH, "%s",
+ _("Agent authentication is not supported on this host"));
+ return -1;
+#else
virNetLibsshAuthMethod *auth;
virObjectLock(sess);
@@ -873,6 +882,7 @@ virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSession *sess)
virObjectUnlock(sess);
return 0;
+#endif
}
int
--
2.39.2