summaryrefslogtreecommitdiff
path: root/deps/lua/src/lua.h
diff options
context:
space:
mode:
authormeir <meir@redis.com>2022-02-15 20:18:49 +0200
committermeir <meir@redis.com>2022-04-27 00:37:40 +0300
commitefa162bcd7ab1477c07d8ee85537e27c0cb1524b (patch)
tree900e0b068a2f9c4dd351206caf2a368b12bb94bb /deps/lua/src/lua.h
parent3731580b6b80c586322cadc6bc4be2b8b2bbb206 (diff)
downloadredis-efa162bcd7ab1477c07d8ee85537e27c0cb1524b.tar.gz
Protect any table which is reachable from globals and added globals white list.
The white list is done by setting a metatable on the global table before initializing any library. The metatable set the `__newindex` field to a function that check the white list before adding the field to the table. Fields which is not on the white list are simply ignored. After initialization phase is done we protect the global table and each table that might be reachable from the global table. For each table we also protect the table metatable if exists.
Diffstat (limited to 'deps/lua/src/lua.h')
-rw-r--r--deps/lua/src/lua.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/deps/lua/src/lua.h b/deps/lua/src/lua.h
index e478d14c0..280ef2382 100644
--- a/deps/lua/src/lua.h
+++ b/deps/lua/src/lua.h
@@ -359,6 +359,7 @@ struct lua_Debug {
};
LUA_API void lua_enablereadonlytable (lua_State *L, int index, int enabled);
+LUA_API int lua_isreadonlytable (lua_State *L, int index);
/* }====================================================================== */