Seems to me that a read only connection shouldn't be able to dump domain
xml with the SECURE flag. Attached patch blocks the attempt with an
explicit error message.

Thanks,
Cole
diff --git a/src/libvirt.c b/src/libvirt.c
index bf3453a..6e73cff 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2619,6 +2619,12 @@ virDomainGetXMLDesc(virDomainPtr domain, int flags)
 
     conn = domain->conn;
 
+    if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
+        virLibConnError(conn, VIR_ERR_OPERATION_DENIED,
+                        _("%s with secure flag"), __FUNCTION__);
+        goto error;
+    }
+
     if (conn->driver->domainDumpXML) {
         char *ret;
         ret = conn->driver->domainDumpXML (domain, flags);
--
Libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to