From aac6018a358259a6c5314644292d26a79f7f0de4 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 23 Mar 2009 16:36:32 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ src/virsh.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae5678f83f..1ee016d803 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 23 17:33:17 CET 2009 Daniel Veillard + + * 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 * src/util.c: flag unused parameters, by Maximilian Wilhelm diff --git a/src/virsh.c b/src/virsh.c index 9a7b0ed673..abbd93b85b 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -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. */