Fix bugs and add security features to redbean

- Fix a regression with the previous change that broke redbean
- Add chroot(), resource limit, seccomp, and other stuff to redbean
- Write lots and lots of documentation
- Iron out more system call issues
This commit is contained in:
Justine Tunney 2022-04-18 00:01:26 -07:00
parent f1dfa4bdfa
commit 7166679620
182 changed files with 1855 additions and 918 deletions

View file

@ -29,8 +29,20 @@
char testlib_enable_tmp_setup_teardown;
TEST(access, testNull_returnsEfault) {
TEST(access, efault) {
ASSERT_SYS(EFAULT, -1, access(0, F_OK));
if (IsWindows() && !IsAsan()) return; // not possible
ASSERT_SYS(EFAULT, -1, access((void *)77, F_OK));
}
TEST(access, enoent) {
ASSERT_SYS(ENOENT, -1, access("doesnotexist", F_OK));
ASSERT_SYS(ENOENT, -1, access("o/doesnotexist", F_OK));
}
TEST(access, enotdir) {
ASSERT_SYS(0, 0, touch("o", 0644));
ASSERT_SYS(ENOTDIR, -1, access("o/doesnotexist", F_OK));
}
TEST(access, test) {