]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: qemuOpenFileAs - set flag VIR_FILE_OPEN_FORCE_MODE
authorJohn Ferlan <jferlan@redhat.com>
Mon, 26 Jan 2015 19:28:25 +0000 (14:28 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 11 Feb 2015 12:29:29 +0000 (07:29 -0500)
In the event we're falling into the code that tries to create the file
in a forked environment (VIR_FILE_OPEN_FORK) we pass different mode bits,
but those are never set because the virFileOpenForceOwnerMode has a check
if the OPEN_FORCE_MODE bit is set before attempting to change the mode.

Since this is a special case it seems reasonable to set u+rw,g+rw,o

src/qemu/qemu_driver.c

index e3ca437dabd516c4b7d9a522db55bcbafc58ebd2..26fc6a2a0c9af12632bb46370dc2cfee665701bc 100644 (file)
@@ -2961,6 +2961,9 @@ qemuOpenFileAs(uid_t fallback_uid, gid_t fallback_gid,
 
             /* Retry creating the file as qemu user */
 
+            /* Since we're passing different modes... */
+            vfoflags |= VIR_FILE_OPEN_FORCE_MODE;
+
             if ((fd = virFileOpenAs(path, oflags,
                                     S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP,
                                     fallback_uid, fallback_gid,