]> xenbits.xensource.com Git - libvirt.git/commitdiff
virNodeAllocPages: Disallow RO connection
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Sep 2014 15:12:46 +0000 (17:12 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Sep 2014 15:12:46 +0000 (17:12 +0200)
Due to a missing check the API can be successfully called even if
the connection is ReadOnly. Fortunately, the API hasn't been
released yet, so there's no need for a CVE.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/libvirt.c

index 388c040c6a2549daf1be63fcdb645db26d889478..245c373bcc135d4b657663ee37256f2b86717bfb 100644 (file)
@@ -21893,6 +21893,7 @@ virNodeAllocPages(virConnectPtr conn,
     virResetLastError();
 
     virCheckConnectReturn(conn, -1);
+    virCheckReadOnlyGoto(conn->flags, error);
     virCheckNonZeroArgGoto(npages, error);
     virCheckNonNullArgGoto(pageSizes, error);
     virCheckNonNullArgGoto(pageCounts, error);