Scripting: globals protection can now be switched on/off.

This commit is contained in:
antirez
2012-04-13 11:16:50 +02:00
parent 430602b26c
commit 3e6a4463e0
5 changed files with 82 additions and 33 deletions

View File

@ -585,6 +585,7 @@ struct redisServer {
int lua_timedout; /* True if we reached the time limit for script
execution. */
int lua_kill; /* Kill the script if true. */
int lua_protect_globals; /* If true globals must be declared */
/* Assert & bug reportign */
char *assert_failed;
char *assert_file;
@ -960,6 +961,8 @@ int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *num
/* Scripting */
void scriptingInit(void);
void scriptingEnableGlobalsProtection(lua_State *lua);
void scriptingDisableGlobalsProtection(lua_State *lua);
/* Git SHA1 */
char *redisGitSHA1(void);