Commit afb48c6c authored by Oran Agra's avatar Oran Agra
Browse files

Whitelist Lua print function to avoid breaking change in old releases

parent 7fddebc2
...@@ -87,6 +87,7 @@ static char *lua_builtins_allow_list[] = { ...@@ -87,6 +87,7 @@ static char *lua_builtins_allow_list[] = {
"setfenv", "setfenv",
"load", "load",
"error", "error",
"print", /* should be blocked, but kept in old releases to avoid breaking change. */
NULL, NULL,
}; };
...@@ -126,7 +127,6 @@ static char **allow_lists[] = { ...@@ -126,7 +127,6 @@ static char **allow_lists[] = {
static char *deny_list[] = { static char *deny_list[] = {
"dofile", "dofile",
"loadfile", "loadfile",
"print",
NULL, NULL,
}; };
......
...@@ -687,14 +687,14 @@ start_server {tags {"scripting"}} { ...@@ -687,14 +687,14 @@ start_server {tags {"scripting"}} {
set _ $e set _ $e
} {*Script attempted to access nonexistent global variable 'dofile'*} } {*Script attempted to access nonexistent global variable 'dofile'*}
test "Test print are not available" { test "Test print is available to avoid breaking change" {
catch { catch {
r eval { r eval {
print('some data') print('some data')
} 0 } 0
} e } e
set _ $e set _ $e
} {*Script attempted to access nonexistent global variable 'print'*} } {}
test {Script return recursive object} { test {Script return recursive object} {
r readraw 1 r readraw 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment