fix missing authentication on virsh shell commands

* src/virsh.c: fix missing authentication when command are issued
  from the shell, patch by Matthias Bolte
Daniel
This commit is contained in:
Daniel Veillard 2009-03-23 16:36:32 +00:00
parent de4950b200
commit aac6018a35
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Mon Mar 23 17:33:17 CET 2009 Daniel Veillard <veillard@redhat.com>
* src/virsh.c: fix missing authentication when command are issued
from the shell, patch by Matthias Bolte
Fri Mar 20 21:43:57 CET 2009 Daniel Veillard <veillard@redhat.com>
* src/util.c: flag unused parameters, by Maximilian Wilhelm

View File

@ -468,13 +468,14 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
ctl->name = vshStrdup(ctl, vshCommandOptString(cmd, "name", NULL));
if (!ro) {
ctl->conn = virConnectOpen(ctl->name);
ctl->readonly = 0;
} else {
ctl->conn = virConnectOpenReadOnly(ctl->name);
ctl->readonly = 1;
}
ctl->conn = virConnectOpenAuth(ctl->name, virConnectAuthPtrDefault,
ctl->readonly ? VIR_CONNECT_RO : 0);
if (!ctl->conn)
vshError(ctl, FALSE, "%s", _("Failed to connect to the hypervisor"));
@ -2315,7 +2316,7 @@ cmdMigrate (vshControl *ctl, const vshCmd *cmd)
flags |= VIR_MIGRATE_LIVE;
/* Temporarily connect to the destination host. */
dconn = virConnectOpen (desturi);
dconn = virConnectOpenAuth (desturi, virConnectAuthPtrDefault, 0);
if (!dconn) goto done;
/* Migrate. */