mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
vbox_common.c: use 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:
parent
f372c27592
commit
a483134bd0
@ -517,20 +517,8 @@ vboxConnectOpen(virConnectPtr conn,
|
||||
|
||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
||||
|
||||
if (uid != 0) {
|
||||
if (STRNEQ(conn->uri->path, "/session")) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown driver path '%s' specified (try vbox:///session)"), conn->uri->path);
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
} else { /* root */
|
||||
if (STRNEQ(conn->uri->path, "/system") &&
|
||||
STRNEQ(conn->uri->path, "/session")) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown driver path '%s' specified (try vbox:///system)"), conn->uri->path);
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
}
|
||||
if (!virConnectValidateURIPath(conn->uri->path, "vbox", uid == 0))
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
|
||||
if (!(driver = vboxGetDriverConnection()))
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user