From: Michal Privoznik Date: Mon, 22 Aug 2011 13:48:52 +0000 (+0200) Subject: remote: Refuse connecting to remote socket X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c4f91b144c1ce43ba83ca45f0c0c818f1bca55be;p=libvirt.git remote: Refuse connecting to remote socket If users wants to connect to remote unix socket, e.g. 'qemu+unix:///system' currently the part is ignored, ending up connecting to localhost. Connecting to remote socket is not supported and user should have used TLS/TCP/SSH instead. --- diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 28f333b956..603d589d58 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -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;