diff --git a/utils.c b/utils.c index 476e1907..16f61fff 100644 --- a/utils.c +++ b/utils.c @@ -357,6 +357,10 @@ void uwsgi_as_root() { uwsgi_error("setgid()"); exit(1); } + if (setgroups(0, NULL)) { + uwsgi_error("setgroups()"); + exit(1); + } } if (uwsgi.uid) { if (!uwsgi.master_as_root) uwsgi_log("setuid() to %d\n", uwsgi.uid); diff --git a/uwsgi.c b/uwsgi.c index 10869942..3903cf61 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -957,6 +957,13 @@ options_parsed: uwsgi.shared_sockets[i].bound = 1; } + // call jail systems + for(i =0; i < uwsgi.gp_cnt; i++) { + if (uwsgi.gp[i]->jail) { + uwsgi.gp[i]->jail(uwsgi_start, argv); + } + } + #ifdef __linux__ diff --git a/uwsgi.h b/uwsgi.h index c011c4fa..2bda9c68 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -507,6 +507,8 @@ struct uwsgi_plugin { uint16_t (*rpc)(void *, uint8_t, char **, char *); + void (*jail) (int (*)(void *), char**); + struct uwsgi_help_item *help; };