Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
afb48c6c
Commit
afb48c6c
authored
Apr 27, 2022
by
Oran Agra
Browse files
Whitelist Lua print function to avoid breaking change in old releases
parent
7fddebc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
afb48c6c
...
...
@@ -87,6 +87,7 @@ static char *lua_builtins_allow_list[] = {
"setfenv"
,
"load"
,
"error"
,
"print"
,
/* should be blocked, but kept in old releases to avoid breaking change. */
NULL
,
};
...
...
@@ -126,7 +127,6 @@ static char **allow_lists[] = {
static
char
*
deny_list
[]
=
{
"dofile"
,
"loadfile"
,
"print"
,
NULL
,
};
...
...
tests/unit/scripting.tcl
View file @
afb48c6c
...
...
@@ -687,14 +687,14 @@ start_server {tags {"scripting"}} {
set _ $e
}
{
*Script attempted to access nonexistent global variable 'dofile'*
}
test
"Test print
are not availabl
e"
{
test
"Test print
is available to avoid breaking chang
e"
{
catch
{
r eval
{
print
(
'some data'
)
}
0
}
e
set _ $e
}
{
*Script attempted to access nonexistent global variable 'print'*
}
}
{}
test
{
Script return recursive object
}
{
r readraw 1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment