mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:17:35 +00:00
IRCClient: Refuse to run as root
There's no good reason to allow this, and some pretty great reasons to disallow it. :^)
This commit is contained in:
parent
e8b17c42bb
commit
b2b5da8a17
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include "IRCAppWindow.h"
|
#include "IRCAppWindow.h"
|
||||||
#include "IRCClient.h"
|
#include "IRCClient.h"
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
|
#include <LibGUI/MessageBox.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
@ -36,6 +37,11 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getuid() == 0) {
|
||||||
|
fprintf(stderr, "Refusing to run as root\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
GUI::Application app(argc, argv);
|
GUI::Application app(argc, argv);
|
||||||
|
|
||||||
if (pledge("stdio inet dns unix shared_buffer rpath", nullptr) < 0) {
|
if (pledge("stdio inet dns unix shared_buffer rpath", nullptr) < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue