[lxc-devel] [lxcfs/master] set mode for /run/controllers to 755

brauner on Github lxc-bot at linuxcontainers.org
Mon Apr 25 11:25:09 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 586 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160425/cd709498/attachment.bin>
-------------- next part --------------
From a62c4d3df393414ab200ef0b3afa70de372e74c9 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at mailbox.org>
Date: Mon, 25 Apr 2016 13:12:11 +0200
Subject: [PATCH] set mode for /run/controllers to 755

Let's set it to the same mode as /sys/fs/cgroup. Also, tools like Docker will
complain about not being able to stat /run/lxcfs/controllers when mode is set to
700.

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>
---
 lxcfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxcfs.c b/lxcfs.c
index 6f37052..11e8ff5 100644
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -799,7 +799,7 @@ static bool umount_if_mounted(void)
 
 static bool setup_cgfs_dir(void)
 {
-	if (!mkdir_p(basedir, 0700)) {
+	if (!mkdir_p(basedir, 0755)) {
 		fprintf(stderr, "Failed to create lxcfs cgdir\n");
 		return false;
 	}
@@ -807,7 +807,7 @@ static bool setup_cgfs_dir(void)
 		fprintf(stderr, "Failed to clean up old lxcfs cgdir\n");
 		return false;
 	}
-	if (mount("tmpfs", basedir, "tmpfs", 0, "size=100000,mode=700") < 0) {
+	if (mount("tmpfs", basedir, "tmpfs", 0, "size=100000,mode=755") < 0) {
 		fprintf(stderr, "Failed to mount tmpfs for private controllers\n");
 		return false;
 	}


More information about the lxc-devel mailing list