|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
From 185aa53dbf2dc882940487b35fae6dccd5097466 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
From: Seth Jennings <sjenning@redhat.com>
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Date: Tue, 5 May 2015 13:31:01 -0500
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Subject: [PATCH] Fix permissions on /run/systemd/nspawn/locks
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
machined is getting an EACCES when trying to create the lock file for
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
images because the mode on /run/systemd/nspawn/locks is 0600.
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
mkdir("/run/systemd/nspawn/locks", 0600) = -1 EEXIST (File exists)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
stat("/run/systemd/nspawn/locks", {st_mode=S_IFDIR|0600, st_size=40, ...}) = 0
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
open("/run/systemd/nspawn/locks/inode-41:256", O_RDWR|O_CREAT|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC, 0600) = -1 EACCES (Permission denied)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
This commit adjusts the mode to 0700 to correct the issue.
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
(cherry picked from commit 7e7cddb22493642dad826ec42ac00979f40b2d17)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
src/shared/machine-image.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
index 8d61507e84..c02ee814c4 100644
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
--- a/src/shared/machine-image.c
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
+++ b/src/shared/machine-image.c
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
@@ -601,7 +601,7 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
if (p) {
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
- mkdir_p("/run/systemd/nspawn/locks", 0600);
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
+ mkdir_p("/run/systemd/nspawn/locks", 0700);
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
r = make_lock_file(p, operation, global);
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
@@ -628,7 +628,7 @@ int image_name_lock(const char *name, int operation, LockFile *ret) {
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
if (streq(name, ".host"))
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
return -EBUSY;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
- mkdir_p("/run/systemd/nspawn/locks", 0600);
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
+ mkdir_p("/run/systemd/nspawn/locks", 0700);
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
p = strjoina("/run/systemd/nspawn/locks/name-", name);
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
return make_lock_file(p, operation, ret);
|