1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

Browser: Refuse to run as root

This commit is contained in:
Andreas Kling 2020-03-31 13:01:55 +02:00
parent b2b5da8a17
commit 297e6625f3

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;