From: Ján Tomko Date: Wed, 3 Oct 2018 12:10:13 +0000 (+0200) Subject: qemu: fix up permissions for pre-created UNIX sockets X-Git-Tag: v4.9.0-rc1~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ba65c4d95712b54362fd81c34bae99f51d45a0b;p=thirdparty%2Flibvirt.git qemu: fix up permissions for pre-created UNIX sockets My commit d6b8838 fixed the uid:gid for the pre-created UNIX sockets but did not account for the different umask of libvirtd and QEMU. Since commit 0e1a1a8c we set umask to '0002' for the QEMU process. Manually tune-up the permissions to match what we would have gotten if QEMU had created the socket. https://bugzilla.redhat.com/show_bug.cgi?id=1633389 Signed-off-by: Ján Tomko Reviewed-by: Jiri Denemark --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 887947dc11..d77cf8c2d6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5034,6 +5034,12 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev) goto error; } + /* We run QEMU with umask 0002. Compensate for the umask + * libvirtd might be running under to get the same permission + * QEMU would have. */ + if (virFileUpdatePerm(dev->data.nix.path, 0002, 0664) < 0) + goto error; + return fd; error: