bridge_driver.c: virConnectValidateURIPath()

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Suggested-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Daniel Henrique Barboza 2019-09-26 11:56:39 -03:00 committed by Cole Robinson
parent fac2f08bdd
commit 9902062861

View File

@ -938,21 +938,10 @@ networkConnectOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR;
}
if (network_driver->privileged) {
if (STRNEQ(conn->uri->path, "/system")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected network URI path '%s', try network:///system"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
} else {
if (STRNEQ(conn->uri->path, "/session")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected network URI path '%s', try network:///session"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
}
if (!virConnectValidateURIPath(conn->uri->path,
"network",
network_driver->privileged))
return VIR_DRV_OPEN_ERROR;
if (virConnectOpenEnsureACL(conn) < 0)
return VIR_DRV_OPEN_ERROR;