提交 953f046d 编写于 作者: D Daniel P. Berrangé

remote: use VIR_DRV_OPEN_REMOTE_USER in ssh transport checks

We currently refuse to connect to remote libvirtd over SSH if we see the
path ends in /session. Earlier on though we checked for /session and set
the VIR_DRV_OPEN_REMOTE_USER flag. There is one subtle distinction
though with the test driver. All test URIs are marked with this flag,
regardless of whether the URI indicates a local or remote connection.
Previously a local connection to the test driver would have used the
unprivileged libvirtd while a remote connection would have tried the
privileged libvirtd. With this we are consistent and use the
unprivileged for both local & remote, if the current user is non-root.
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 00d17254
...@@ -1000,7 +1000,7 @@ doRemoteOpen(virConnectPtr conn, ...@@ -1000,7 +1000,7 @@ doRemoteOpen(virConnectPtr conn,
case trans_libssh2: case trans_libssh2:
if (!sockname) { if (!sockname) {
/* Right now we don't support default session connections */ /* Right now we don't support default session connections */
if (STREQ_NULLABLE(conn->uri->path, "/session")) { if (flags & VIR_DRV_OPEN_REMOTE_USER) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Connecting to session instance without " _("Connecting to session instance without "
"socket path is not supported by the libssh2 " "socket path is not supported by the libssh2 "
...@@ -1035,7 +1035,7 @@ doRemoteOpen(virConnectPtr conn, ...@@ -1035,7 +1035,7 @@ doRemoteOpen(virConnectPtr conn,
case trans_libssh: case trans_libssh:
if (!sockname) { if (!sockname) {
/* Right now we don't support default session connections */ /* Right now we don't support default session connections */
if (STREQ_NULLABLE(conn->uri->path, "/session")) { if (flags & VIR_DRV_OPEN_REMOTE_USER) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Connecting to session instance without " _("Connecting to session instance without "
"socket path is not supported by the libssh " "socket path is not supported by the libssh "
...@@ -1100,7 +1100,7 @@ doRemoteOpen(virConnectPtr conn, ...@@ -1100,7 +1100,7 @@ doRemoteOpen(virConnectPtr conn,
if (!sockname) { if (!sockname) {
/* Right now we don't support default session connections */ /* Right now we don't support default session connections */
if (STREQ_NULLABLE(conn->uri->path, "/session")) { if (flags & VIR_DRV_OPEN_REMOTE_USER) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Connecting to session instance without " _("Connecting to session instance without "
"socket path is not supported by the ssh " "socket path is not supported by the ssh "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册