From c4f91b144c1ce43ba83ca45f0c0c818f1bca55be Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 22 Aug 2011 15:48:52 +0200 Subject: [PATCH] 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. --- src/remote/remote_driver.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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; -- 2.47.2