diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-06-30 00:11:25 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-30 00:11:25 +0200 |
commit | 64747e2d4b6feb61e9f9e70d36ffcf5a972e168a (patch) | |
tree | 9eb50a36c3db5705d02982bd142526f49c8d92e2 /src/cgroup.c | |
parent | 8585357a0e5e9f4d56e999d7cd1a73e77ae0eb80 (diff) |
exec: add ControlGroupModify= switch to allow changing access mode to cgroups fs
Diffstat (limited to 'src/cgroup.c')
-rw-r--r-- | src/cgroup.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/cgroup.c b/src/cgroup.c index 0c6f20d4b7..a3491582be 100644 --- a/src/cgroup.c +++ b/src/cgroup.c @@ -140,6 +140,50 @@ int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid) { return 0; } +int cgroup_bonding_set_group_access(CGroupBonding *b, mode_t mode, uid_t uid, gid_t gid) { + assert(b); + + if (!b->realized) + return -EINVAL; + + return cg_set_group_access(b->controller, b->path, mode, uid, gid); +} + +int cgroup_bonding_set_group_access_list(CGroupBonding *first, mode_t mode, uid_t uid, gid_t gid) { + CGroupBonding *b; + int r; + + LIST_FOREACH(by_unit, b, first) { + r = cgroup_bonding_set_group_access(b, mode, uid, gid); + if (r < 0) + return r; + } + + return 0; +} + +int cgroup_bonding_set_task_access(CGroupBonding *b, mode_t mode, uid_t uid, gid_t gid) { + assert(b); + + if (!b->realized) + return -EINVAL; + + return cg_set_task_access(b->controller, b->path, mode, uid, gid); +} + +int cgroup_bonding_set_task_access_list(CGroupBonding *first, mode_t mode, uid_t uid, gid_t gid) { + CGroupBonding *b; + int r; + + LIST_FOREACH(by_unit, b, first) { + r = cgroup_bonding_set_task_access(b, mode, uid, gid); + if (r < 0) + return r; + } + + return 0; +} + int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, Set *s) { assert(b); assert(sig >= 0); |