diff --git a/buildconf/default.ini b/buildconf/default.ini index ac4b691f..1a73b3f2 100644 --- a/buildconf/default.ini +++ b/buildconf/default.ini @@ -37,6 +37,9 @@ event = auto timer = auto filemonitor = auto +blacklist = +whitelist = + embed_files = embed_config = diff --git a/utils.c b/utils.c index 1646683c..2ecf451b 100644 --- a/utils.c +++ b/utils.c @@ -1859,6 +1859,32 @@ int uwsgi_logic_opt_for(char *key, char *value) { void add_exported_option(char *key, char *value, int configured) { + struct uwsgi_string_list *blacklist = uwsgi.blacklist; + struct uwsgi_string_list *whitelist = uwsgi.whitelist; + + while(blacklist) { + if (!strcmp(key, blacklist->value)) { + uwsgi_log("uWSGI error: forbidden option \"%s\"\n", key); + exit(1); + } + blacklist = blacklist->next; + } + + if (whitelist) { + int allowed = 0; + while(whitelist) { + if (!strcmp(key, whitelist->value)) { + allowed = 1; + break; + } + whitelist = whitelist->next; + } + if (!allowed) { + uwsgi_log("uWSGI error: forbidden option \"%s\"\n", key); + exit(1); + } + } + if (uwsgi.logic_opt_running) goto add; if (!strcmp(key, "end") || !strcmp(key, "endfor") || !strcmp(key, "endif")) { @@ -3938,6 +3964,17 @@ char *uwsgi_check_touches(struct uwsgi_string_list *touch_list) { return NULL; } +char *uwsgi_chomp(char *str) { + size_t i; + for(i=0;i