lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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.