lua-users home
lua-l archive

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


David,

You may modify the package.searchers table, namely deleting all searchers you don't want to get used.
As these a C functions, it's unlikely that a Lua script can re-create them.

-- Oliver

Am 02.04.2014 10:18, schrieb David Demelier:
Hello all,

I like to preload libraries in my application in package.preload so there are not globals and user can still load them individually with `require'. However, I'm guessing if it is possible to sandbox the require function so it only seeks the host application package.preload list instead of all the other ones.

But users can still modify the package.* variables in its user script (even if we add a __newindex or securities like that, it can uses rawset).

What is your advice on that?

Regards,

--
David Demelier