]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
screenshot: Set access rights to temporary file
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 29 Jun 2011 08:17:51 +0000 (10:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 29 Jun 2011 10:05:34 +0000 (12:05 +0200)
Although we create a temporary file, it is owned by root:root and have
rights 0600. In case qemu does not run under root, it is unable to write
to that file and thus we transfer 0B sized file.

src/qemu/qemu_driver.c

index 8b65c2646f010fec8a60e2750567237c47703e4e..562ec4205cf2a8ad8c5695628d7920a29cf8f8d4 100644 (file)
@@ -2729,6 +2729,8 @@ qemuDomainScreenshot(virDomainPtr dom,
         goto endjob;
     }
 
+    virSecurityManagerSetSavedStateLabel(qemu_driver->securityManager, vm, tmp);
+
     qemuDomainObjEnterMonitor(vm);
     if (qemuMonitorScreendump(priv->mon, tmp) < 0) {
         qemuDomainObjExitMonitor(vm);