Browser: Refuse to run as root

This commit is contained in:
Andreas Kling 2020-03-31 13:01:55 +02:00
commit 297e6625f3
Notes: sideshowbarker 2024-07-19 08:02:22 +09:00

View file

@ -62,6 +62,11 @@ static String s_title = "";
int main(int argc, char** argv)
{
if (getuid() == 0) {
fprintf(stderr, "Refusing to run as root\n");
return 1;
}
if (pledge("stdio shared_buffer accept unix cpath rpath wpath fattr", nullptr) < 0) {
perror("pledge");
return 1;