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:
parent
b2b5da8a17
commit
297e6625f3
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue