Re: how to restrict lua syntax for files to be loaded
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: how to restrict lua syntax for files to be loaded
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2012年3月26日 18:22:14 -0300
> I am new to lua and I want to ask whether it is able to restrict lua
> syntax in files to be loaded to prevent them to contain some malicious
> constructs like "while 1 do end". I know that config should be loaded
> in jail, but is there a way to allow only tables, assignments and
> strings in a file to be loaded as lua script?
You could add a token filter and raise an error when any keyword is seen,
though you may want to allow these: and, false, nil, not, or, true.