1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

remote: Refuse connecting to remote socket

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.
This commit is contained in:
Michal Privoznik 2011-08-22 15:48:52 +02:00
parent 6c7299d47d
commit c4f91b144c

View 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;