[libvirt] [PATCH] screenshot: Set access rights to temporary file

Michal Privoznik mprivozn at redhat.com
Wed Jun 29 11:07:35 UTC 2011


On 29.06.2011 11:39, Daniel P. Berrange wrote:
> On Wed, Jun 29, 2011 at 10:23:38AM +0200, Michal Privoznik wrote:
>> 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.
> 
> Hmm, why didn't QEMU return an error in the monitor in that case ?
> Sounds like a BZ needs to be filed against QEMU
> 
>> ---
>>  src/qemu/qemu_driver.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 8b65c26..562ec42 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -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);
> 
> ACK
> 
> Regards,
> Daniel
Thanks. pushed and filed a bug.

Michal




More information about the libvir-list mailing list