Skip to content

Commit

Permalink
Prevent TDM from being run as root user on Linux - see issue #3195
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.thedarkmod.com/svn/darkmod_src/trunk@5837 49c82d7f-2e2a-0410-a16f-ae8f201b507f
  • Loading branch information
taaaki committed Aug 4, 2013
1 parent 1afe04f commit 5e5a7b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ int main(int argc, const char **argv) {
Sys_Printf( "memory consistency checking enabled\n" );
#endif

// do not allow TDM to be run as root
if ( getuid() == 0 ) {
Sys_Printf( "The Dark Mod should not be run as root.\n" );
Posix_Exit( EXIT_FAILURE );
}

Posix_EarlyInit( );

if ( argc > 1 ) {
Expand Down

0 comments on commit 5e5a7b5

Please sign in to comment.