On 01/28/2015 03:25 PM, John Ferlan wrote: > If we're expecting to create a file somewhere and that fails for some > reason during qemuOpenFileAs, then we unlink the path we're attempting > to create leaving no way to determine what the "existing" privileges, > protections, or labels are that caused the failure (open, change owner > and group, change mode, etc) > > Signed-off-by: John Ferlan <[email protected]> > --- > src/qemu/qemu_driver.c | 3 +++ > 1 file changed, 3 insertions(+)
ACK.
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 0174c87..89b54c8 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -2899,6 +2899,9 @@ qemuOpenFileAs(uid_t fallback_uid, gid_t fallback_gid,
> vfoflags |= VIR_FILE_OPEN_FORCE_OWNER;
>
> if (stat(path, &sb) == 0) {
> + /* It already exists, we don't want to delete it on error */
> + need_unlink = false;
> +
> is_reg = !!S_ISREG(sb.st_mode);
> /* If the path is regular file which exists
> * already and dynamic_ownership is off, we don't
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/libvir-list
