diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-05-21 19:30:55 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-05-21 19:30:55 +0200 |
commit | fff7c41f6208c8572f34af2f0ad7160c2d9cb9c5 (patch) | |
tree | f3b7af54ba237e3f178b8997644fd6c306b563d7 /src/jail.c | |
parent | d8bd0e26174f31b25d92189d640fce6f58e92ace (diff) |
POTD skeleton #70.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/jail.c')
-rw-r--r-- | src/jail.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -168,6 +168,10 @@ static int jail_mainloop(event_ctx **ev_ctx, const jail_ctx *ctx[], size_t siz) set_procname("[potd] jail"); assert( set_child_sighandler() == 0 ); + D2("%s", "Setup cgroups"); + if (cgroups_set()) + FATAL("%s", "Setup cgroups"); + rc = event_loop(*ev_ctx, jail_accept_client, &ev_jail); event_free(ev_ctx); @@ -259,6 +263,10 @@ static int jail_childfn(prisoner_process *ctx) if (clearenv()) FATAL("Clearing ENV for pid %d", self_pid); + D2("Activating cgroups for pid %d", self_pid); + if (cgroups_activate()) + FATAL("Activating cgroups for pid %d", self_pid); + caps_drop_dac_override(0); //caps_drop_all(); |