diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-03-13 14:38:56 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-03-13 14:41:41 -0700 |
commit | ee7f893a7e9440b0caaeddb804e8e1ac34f5c9a2 (patch) | |
tree | e391d63f26491b8486b3a8936a261d70da0e9625 /src | |
parent | 35a6794386d347baec5349fceeb419f940361b87 (diff) | |
download | teliva-ee7f893a7e9440b0caaeddb804e8e1ac34f5c9a2.tar.gz |
drop string.dump, clean up docs around it
Diffstat (limited to 'src')
-rw-r--r-- | src/lbaselib.c | 4 | ||||
-rw-r--r-- | src/lstrlib.c | 21 |
2 files changed, 5 insertions, 20 deletions
diff --git a/src/lbaselib.c b/src/lbaselib.c index 8a4d651..6f78f7f 100644 --- a/src/lbaselib.c +++ b/src/lbaselib.c @@ -380,10 +380,14 @@ static int luaB_newproxy (lua_State *L) { static const luaL_Reg base_funcs[] = { {"assert", luaB_assert}, {"collectgarbage", luaB_collectgarbage}, + /* no 'dofile' without sandboxing it */ {"error", luaB_error}, {"gcinfo", luaB_gcinfo}, {"getfenv", luaB_getfenv}, {"getmetatable", luaB_getmetatable}, + /* no 'loadfile' without sandboxing it */ + /* no 'load' without sandboxing it */ + /* no 'loadstring' without sandboxing it */ {"next", luaB_next}, {"pcall", luaB_pcall}, {"print", luaB_print}, diff --git a/src/lstrlib.c b/src/lstrlib.c index 7a03489..8ac753d 100644 --- a/src/lstrlib.c +++ b/src/lstrlib.c @@ -137,25 +137,6 @@ static int str_char (lua_State *L) { } -static int writer (lua_State *L, const void* b, size_t size, void* B) { - (void)L; - luaL_addlstring((luaL_Buffer*) B, (const char *)b, size); - return 0; -} - - -static int str_dump (lua_State *L) { - luaL_Buffer b; - luaL_checktype(L, 1, LUA_TFUNCTION); - lua_settop(L, 1); - luaL_buffinit(L,&b); - if (lua_dump(L, writer, &b) != 0) - luaL_error(L, "unable to dump given function"); - luaL_pushresult(&b); - return 1; -} - - /* ** {====================================================== @@ -827,7 +808,7 @@ static int str_format (lua_State *L) { static const luaL_Reg strlib[] = { {"byte", str_byte}, {"char", str_char}, - {"dump", str_dump}, + /* no 'dump' without sandboxing 'loadstring', etc. */ {"find", str_find}, {"format", str_format}, {"gfind", gfind_nodef}, |