]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
libvirt-domain: forbid use virDomainRename in readonly connection
authorLuyao Huang <lhuang@redhat.com>
Mon, 17 Aug 2015 05:22:00 +0000 (13:22 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 17 Aug 2015 16:43:17 +0000 (12:43 -0400)
This function will change the guest name, we shouldn't
allow the readonly user do this.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/libvirt-domain.c

index 9065dab120a9100d9a319f40609725663d071cd4..9314f85062dcfa140360dd8a421b108a01a9a2fa 100644 (file)
@@ -8796,6 +8796,7 @@ virDomainRename(virDomainPtr dom,
     virResetLastError();
     virCheckDomainReturn(dom, -1);
     virCheckNonNullArgGoto(new_name, error);
+    virCheckReadOnlyGoto(dom->conn->flags, error);
 
     if (dom->conn->driver->domainRename) {
         int ret = dom->conn->driver->domainRename(dom, new_name, flags);