]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Really fix setting mode for backend exec in NFS root-squash env
authorJohn Ferlan <jferlan@redhat.com>
Tue, 17 Nov 2015 13:49:19 +0000 (08:49 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 20 Nov 2015 22:07:13 +0000 (17:07 -0500)
commitce6506b0bc93012f872c860649835f870ba7e278
tree1b5417a17bc42bb83a9e8642995d0e226bed4816
parent16562bbc587add5a03a01c8eb8607c9e05819607
storage: Really fix setting mode for backend exec in NFS root-squash env

https://bugzilla.redhat.com/show_bug.cgi?id=1282288

Although commit id '77346f27' resolves part of the problem regarding creating
a qemu-img image in an NFS root-squash environment, it really didn't fix the
entire problem. Unfortunately it only masked the problem. It seems qemu-img
must open/create the image using 0644, which if used by target.perms would
result in the chmod not being called since the mode desired and set match.

Although qemu-img could conceivably ignore the mode when creating, libvirt
has more knowledge of the environment and can make the adjustment to the
mode far more easily by using virFileOpenAs with VIR_FILE_OPEN_FORCE_MODE.
If that's successful, then we know on return the file will have the right
owner and mode, so we can declare success
src/storage/storage_backend.c