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/execute.c | |
parent | 8585357a0e5e9f4d56e999d7cd1a73e77ae0eb80 (diff) |
exec: add ControlGroupModify= switch to allow changing access mode to cgroups fs
Diffstat (limited to 'src/execute.c')
-rw-r--r-- | src/execute.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/execute.c b/src/execute.c index b00ccde4d5..6f0f5d09d9 100644 --- a/src/execute.c +++ b/src/execute.c @@ -1246,6 +1246,13 @@ int exec_spawn(ExecCommand *command, r = EXIT_STDIN; goto fail_child; } + + if (cgroup_bondings && context->control_group_modify) + if (cgroup_bonding_set_group_access_list(cgroup_bondings, 0755, uid, gid) < 0 || + cgroup_bonding_set_task_access_list(cgroup_bondings, 0644, uid, gid) < 0) { + r = EXIT_CGROUP; + goto fail_child; + } } #ifdef HAVE_PAM @@ -1649,12 +1656,14 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { "%sWorkingDirectory: %s\n" "%sRootDirectory: %s\n" "%sNonBlocking: %s\n" - "%sPrivateTmp: %s\n", + "%sPrivateTmp: %s\n" + "%sControlGroupModify: %s\n", prefix, c->umask, prefix, c->working_directory ? c->working_directory : "/", prefix, c->root_directory ? c->root_directory : "/", prefix, yes_no(c->non_blocking), - prefix, yes_no(c->private_tmp)); + prefix, yes_no(c->private_tmp), + prefix, yes_no(c->control_group_modify)); STRV_FOREACH(e, c->environment) fprintf(f, "%sEnvironment: %s\n", prefix, *e); |