Unverified Commit ed186661 by Serge Hallyn Committed by GitHub

Merge pull request #1907 from brauner/2017-11-08/cgfsng

cgroups/cgfsng: adapt to new cgroup2 delegation
parents 94b308f7 0e17357c
......@@ -1503,6 +1503,25 @@ static int chown_cgroup_wrapper(void *data)
if (chmod(fullpath, 0664) < 0)
WARN("Error chmoding %s: %s", path, strerror(errno));
free(fullpath);
if (!hierarchies[i]->is_cgroup_v2)
continue;
fullpath = must_make_path(path, "cgroup.subtree_control", NULL);
if (chown(fullpath, destuid, 0) < 0 && errno != ENOENT)
WARN("Failed chowning %s to %d: %s", fullpath, (int) destuid,
strerror(errno));
if (chmod(fullpath, 0664) < 0)
WARN("Error chmoding %s: %s", path, strerror(errno));
free(fullpath);
fullpath = must_make_path(path, "cgroup.threads", NULL);
if (chown(fullpath, destuid, 0) < 0 && errno != ENOENT)
WARN("Failed chowning %s to %d: %s", fullpath, (int) destuid,
strerror(errno));
if (chmod(fullpath, 0664) < 0)
WARN("Error chmoding %s: %s", path, strerror(errno));
free(fullpath);
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment