提交 fac2f08b 编写于 作者: D Daniel Henrique Barboza 提交者: Cole Robinson

interface_backend_udev.c: use virConnectValidateURIPath()

Reviewed-by: NCole Robinson <crobinso@redhat.com>
Suggested-by: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 143ef3d0
...@@ -1250,21 +1250,10 @@ udevConnectOpen(virConnectPtr conn, ...@@ -1250,21 +1250,10 @@ udevConnectOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR; return VIR_DRV_OPEN_ERROR;
} }
if (driver->privileged) { if (!virConnectValidateURIPath(conn->uri->path,
if (STRNEQ(conn->uri->path, "/system")) { "interface",
virReportError(VIR_ERR_INTERNAL_ERROR, driver->privileged))
_("unexpected interface URI path '%s', try interface:///system"), return VIR_DRV_OPEN_ERROR;
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
} else {
if (STRNEQ(conn->uri->path, "/session")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected interface URI path '%s', try interface:///session"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
}
if (virConnectOpenEnsureACL(conn) < 0) if (virConnectOpenEnsureACL(conn) < 0)
return VIR_DRV_OPEN_ERROR; return VIR_DRV_OPEN_ERROR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册