]> xenbits.xensource.com Git - libvirt.git/commitdiff
remote: Refuse connecting to remote socket
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Aug 2011 13:48:52 +0000 (15:48 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Aug 2011 14:40:58 +0000 (16:40 +0200)
If users wants to connect to remote unix socket, e.g.
'qemu+unix://<remote>/system' currently the <remote> part is ignored,
ending up connecting to localhost. Connecting to remote socket is not
supported and user should have used TLS/TCP/SSH instead.

src/remote/remote_driver.c

index 28f333b9569b61eefbdff3b478376a61641e1c90..603d589d58055e6c0f7e2ede3b7691b93dcd6f61 100644 (file)
@@ -325,9 +325,17 @@ doRemoteOpen (virConnectPtr conn,
             } else {
                 if (STRCASEEQ (transport_str, "tls"))
                     transport = trans_tls;
-                else if (STRCASEEQ (transport_str, "unix"))
-                    transport = trans_unix;
-                else if (STRCASEEQ (transport_str, "ssh"))
+                else if (STRCASEEQ (transport_str, "unix")) {
+                    if (conn->uri->server) {
+                        remoteError(VIR_ERR_INVALID_ARG,
+                                    _("using unix socket and remote "
+                                      "server '%s' is not supported."),
+                                    conn->uri->server);
+                        return VIR_DRV_OPEN_ERROR;
+                    } else {
+                        transport = trans_unix;
+                    }
+                } else if (STRCASEEQ (transport_str, "ssh"))
                     transport = trans_ssh;
                 else if (STRCASEEQ (transport_str, "ext"))
                     transport = trans_ext;