qemu: Do not allow others into per-VM subdirectories

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2015-09-12 15:00:58 +02:00
parent 64c6695f1a
commit 192a139489

View File

@ -4734,7 +4734,7 @@ int qemuProcessStart(virConnectPtr conn,
if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0) if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0)
goto cleanup; goto cleanup;
if (virFileMakePath(tmppath) < 0) { if (virFileMakePathWithMode(tmppath, 0750) < 0) {
virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath); virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath);
goto cleanup; goto cleanup;
} }
@ -4749,7 +4749,7 @@ int qemuProcessStart(virConnectPtr conn,
cfg->channelTargetDir, vm->def->name) < 0) cfg->channelTargetDir, vm->def->name) < 0)
goto cleanup; goto cleanup;
if (virFileMakePath(tmppath) < 0) { if (virFileMakePathWithMode(tmppath, 0750) < 0) {
virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath); virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath);
goto cleanup; goto cleanup;
} }