[Tarantool-patches] [PATCH v2 luajit 07/30] test: disable Lua tests for bytecode with header

Sergey Ostanevich sergos at tarantool.org
Fri Mar 26 14:30:45 MSK 2021


LGTM.

Sergos


> On 26 Mar 2021, at 10:42, Sergey Kaplun <skaplun at tarantool.org> wrote:
> 
> Loading bytecode with an extra header (BOM or "#") is disabled
> for security reasons since LuaJIT-2.0.0-beta10.
> For more information see comment for `lj_lex_setup()`
> in <src/lj_lex.c>.
> Also see commit 53a285c0c3544ff5dea7c67b741c3c2d06d22b47
> (Disable loading bytecode with an extra header (BOM or #!).).
> 
> These tests are disabled for LuaJIT.
> 
> Relates to tarantool/tarantool#5691
> Part of tarantool/tarantool#5845
> Part of tarantool/tarantool#4473
> ---
> test/PUC-Lua-5.1-tests/main.lua | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/test/PUC-Lua-5.1-tests/main.lua b/test/PUC-Lua-5.1-tests/main.lua
> index 56f56a0..cf6d533 100644
> --- a/test/PUC-Lua-5.1-tests/main.lua
> +++ b/test/PUC-Lua-5.1-tests/main.lua
> @@ -158,13 +158,23 @@ prepfile(s)
> prepfile[[#comment in 1st line without \n at the end]]
> RUN("lua %s", prog)
> 
> +-- Loading bytecode with an extra header (BOM or "#") is disabled
> +-- for security reasons since LuaJIT-2.0.0-beta10.
> +-- For more information see comment for `lj_lex_setup()`
> +-- in <src/lj_lex.c>.
> +-- Also see commit 53a285c0c3544ff5dea7c67b741c3c2d06d22b47
> +-- (Disable loading bytecode with an extra header (BOM or #!).).
> +-- See also https://github.com/tarantool/tarantool/issues/5691.
> +-- FIXME: test is disabled for LuaJIT.
> prepfile("#comment with a binary file\n"..string.dump(loadstring("print(1)")))
> -RUN("lua %s > %s", prog, out)
> -checkout("1\n")
> +-- RUN("lua %s > %s", prog, out)
> +-- checkout("1\n")
> 
> prepfile("#comment with a binary file\r\n"..string.dump(loadstring("print(1)")))
> -RUN("lua %s > %s", prog, out)
> -checkout("1\n")
> +-- Behavior is different for LuaJIT. See the comment above.
> +-- FIXME: test is disabled for LuaJIT.
> +-- RUN("lua %s > %s", prog, out)
> +-- checkout("1\n")
> 
> -- close Lua with an open file
> prepfile(string.format([[io.output(%q); io.write('alo')]], out))
> -- 
> 2.31.0
> 



More information about the Tarantool-patches mailing list