[lxc-devel] [lxc/master] cgfsng: chown the tasks and proc files to container root

hallyn on Github lxc-bot at linuxcontainers.org
Fri Mar 11 03:37:37 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 353 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160311/88d54693/attachment.bin>
-------------- next part --------------
From ccdb9445da0dc975f7f082d3fcf193ad396f5f74 Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge.hallyn at ubuntu.com>
Date: Thu, 10 Mar 2016 19:36:46 -0800
Subject: [PATCH] cgfsng: chown the tasks and proc files to container root

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/cgfsng.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/cgfsng.c b/src/lxc/cgfsng.c
index add95fc..a2504b5 100644
--- a/src/lxc/cgfsng.c
+++ b/src/lxc/cgfsng.c
@@ -1178,12 +1178,12 @@ static int chown_cgroup_wrapper(void *data)
 
 		/* Failures to chown these are inconvenient but not detrimental */
 		fullpath = must_make_path(path, "tasks", NULL);
-		if (chown(fullpath, destuid, 0) < 0 && errno != ENOENT)
+		if (chown(fullpath, 0, 0) < 0 && errno != ENOENT)
 			WARN("Failed chowning %s to %d: %m", fullpath, (int) destuid);
 		free(fullpath);
 
 		fullpath = must_make_path(path, "cgroup.procs", NULL);
-		if (chown(fullpath, destuid, 0) < 0 && errno != ENOENT)
+		if (chown(fullpath, 0, 0) < 0 && errno != ENOENT)
 			WARN("Failed chowning %s to %d: %m", fullpath, (int) destuid);
 		free(fullpath);
 	}


More information about the lxc-devel mailing list