lua-users home
lua-l archive

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


2014-03-31 23:16 GMT+02:00 Thiago L. <fakedme@gmail.com>:

> I don't think the design reason would be "we don't want ppl to sandbox the
> string metatable so we make it impossible for getmetatable to natively call
> __metatable if it's a function and also make it impossible to override that
> behaviour properly without the debug lib"...

> So any way to sandbox the string metatable without the debug lib?

The __metatable field does not get called by Lua. It is the value that will
be returned by getmetatable(). That is all. Whereas debug.getmetatable
returns the actual metatable.

So if you are not willing to exploit the debug library, you are sunk.