提交 c4f91b14 编写于 作者: M Michal Privoznik

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.
上级 6c7299d4
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册