mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-23 19:21:04 +00:00
Prevent user from running dhewm3 as root.
This commit is contained in:
parent
dcbe0b172e
commit
8e0d28374d
1 changed files with 9 additions and 0 deletions
|
@ -396,6 +396,15 @@ main
|
|||
===============
|
||||
*/
|
||||
int main(int argc, char **argv) {
|
||||
// Prevent running Doom 3 as root
|
||||
// Borrowed from Yamagi Quake II
|
||||
if (getuid() == 0) {
|
||||
printf("Doom 3 shouldn't be run as root! Backing out to save your ass. If\n");
|
||||
printf("you really know what you're doing, edit neo/sys/linux/main.cpp and remove\n");
|
||||
printf("this check. But don't complain if an imp kills your bunny afterwards!:)\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
// fallback path to the binary for systems without /proc
|
||||
// while not 100% reliable, its good enough
|
||||
if (argc > 0) {
|
||||
|
|
Loading…
Reference in a new issue