[libvirt PATCH v2 5/6] rpc/ssh: ssh_userauth_agent() is not supported on win32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

The function does not exist on win32.

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/rpc/virnetlibsshsession.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index e71a79d0fb..8cb57e857f 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -700,7 +700,9 @@ virNetLibsshAuthenticate(virNetLibsshSession *sess)
             break;
         case VIR_NET_LIBSSH_AUTH_AGENT:
             /* try to authenticate using ssh-agent */
+#ifndef WIN32
             ret = ssh_userauth_agent(sess->session, NULL);
+#endif
             if (ret == SSH_AUTH_ERROR) {
                 errmsg = ssh_get_error(sess->session);
                 virReportError(VIR_ERR_LIBSSH,
@@ -861,8 +863,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 +880,7 @@ virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSession *sess)
 
     virObjectUnlock(sess);
     return 0;
+#endif
 }
 
 int
-- 
2.40.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux