7a3408
From 1b3b61bc9cd913a2f3fea1ab39ded81c6da2bacd Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <1b3b61bc9cd913a2f3fea1ab39ded81c6da2bacd@dist-git>
7a3408
From: Martin Kletzander <mkletzan@redhat.com>
7a3408
Date: Mon, 14 Sep 2015 10:15:26 +0200
7a3408
Subject: [PATCH] qemu: Do not allow others into per-VM subdirectories
7a3408
7a3408
https://bugzilla.redhat.com/show_bug.cgi?id=1146886
7a3408
7a3408
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7a3408
(cherry picked from commit 192a13948905668955ff39e32d4622f8511fadf0)
7a3408
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/qemu/qemu_process.c | 4 ++--
7a3408
 1 file changed, 2 insertions(+), 2 deletions(-)
7a3408
7a3408
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
7a3408
index d5b0fc0..ee1d6b2 100644
7a3408
--- a/src/qemu/qemu_process.c
7a3408
+++ b/src/qemu/qemu_process.c
7a3408
@@ -4737,7 +4737,7 @@ int qemuProcessStart(virConnectPtr conn,
7a3408
     if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0)
7a3408
         goto cleanup;
7a3408
 
7a3408
-    if (virFileMakePath(tmppath) < 0) {
7a3408
+    if (virFileMakePathWithMode(tmppath, 0750) < 0) {
7a3408
         virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath);
7a3408
         goto cleanup;
7a3408
     }
7a3408
@@ -4752,7 +4752,7 @@ int qemuProcessStart(virConnectPtr conn,
7a3408
                     cfg->channelTargetDir, vm->def->name) < 0)
7a3408
         goto cleanup;
7a3408
 
7a3408
-    if (virFileMakePath(tmppath) < 0) {
7a3408
+    if (virFileMakePathWithMode(tmppath, 0750) < 0) {
7a3408
         virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath);
7a3408
         goto cleanup;
7a3408
     }
7a3408
-- 
7a3408
2.5.2
7a3408