Pledge and unveil redbean's unit tests

This commit is contained in:
Justine Tunney 2022-07-23 05:22:19 -07:00
parent 513a659dd2
commit 31e4b0867b
21 changed files with 44 additions and 6 deletions

View file

@ -1382,13 +1382,13 @@ static int LuaUnixPledge(lua_State *L) {
pledge(luaL_checkstring(L, 1), luaL_optstring(L, 2, 0)));
}
// sandbox.unveil(path:str, permissions:str)
// sandbox.unveil([path:str[, permissions:str]])
// ├─→ true
// └─→ nil, unix.Errno
static int LuaUnixUnveil(lua_State *L) {
int olderr = errno;
return SysretBool(L, "unveil", olderr,
unveil(luaL_checkstring(L, 1), luaL_checkstring(L, 2)));
unveil(luaL_optstring(L, 1, 0), luaL_optstring(L, 2, 0)));
}
// unix.gethostname()