fix(feuille.c): remove pledge stages 1 and 3

Stage 1 was causing issues with the chroot syscall, and, since stage
3 was causing more harm than security in terms of readability, I also
removed it.
This commit is contained in:
Tom MTT 2022-11-21 14:40:51 +01:00
parent 8f75f88950
commit 601f8e4c24
2 changed files with 2 additions and 195 deletions

View file

@ -83,11 +83,6 @@ void version(void)
*/
int main(int argc, char *argv[])
{
/* pledge stage 1 */
#ifdef __OpenBSD__
pledge("stdio rpath wpath cpath inet chown getpw proc id", "stdio wpath inet");
#endif
/* locale */
setlocale(LC_ALL, "");
@ -297,9 +292,9 @@ int main(int argc, char *argv[])
freopen("/dev/null", "w", stderr);
}
/* pledge stage 2 */
/* OpenBSD-only security measures */
#ifdef __OpenBSD__
pledge("stdio proc inet", NULL);
pledge("stdio proc inet", "stdio wpath inet");
#endif
/* create a thread pool for incoming connections */
@ -384,11 +379,6 @@ int main(int argc, char *argv[])
die(errno, "Could not initialize worker n. %d: %s\n", i, strerror(errno));
}
/* pledge stage 3 */
#ifdef __OpenBSD__
pledge("stdio", NULL);
#endif
sleep(1);
verbose(1, "all workers have been initialized.");