[PATCH 2/2] libvirt-domain: forbid use virDomainRename in readonly connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function will change the guest name, we shouldn't
allow the readonly user do this.

Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
---
 src/libvirt-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 9065dab..9314f85 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -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);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]