diff options
author | Bardur Arantsson <bardur@scientician.net> | 2011-04-18 20:37:31 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-03-29 20:57:29 +0200 |
commit | b102a2e0aeb70e93a1122f42e00a7b672f718a07 (patch) | |
tree | 8b7cb08fe9c3251836e8f5a8b975eee452833366 /src/main.c | |
parent | 142e4467809aec4a8dfa5a1126d9cc1d5eea5ed3 (diff) |
Refactor: Remove some dead setuid code.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 42 |
1 files changed, 0 insertions, 42 deletions
@@ -264,57 +264,17 @@ int main(int argc, char *argv[]) argv0 = argv[0]; -#ifdef SET_UID - /* Default permissions on files */ (void)umask(022); -#endif /* SET_UID */ - /* Get the file paths */ init_stuff(); -#ifdef SET_UID - /* Get the user id (?) */ player_uid = getuid(); -# ifdef SAFE_SETUID - -# ifdef _POSIX_SAVED_IDS - - /* Save some info for later */ - player_euid = geteuid(); - player_egid = getegid(); - -# endif - -# if 0 /* XXX XXX XXX */ - - /* Redundant setting necessary in case root is running the game */ - /* If not root or game not setuid the following two calls do nothing */ - - if (setgid(getegid()) != 0) - { - quit("setgid(): cannot set permissions correctly!"); - } - - if (setuid(geteuid()) != 0) - { - quit("setuid(): cannot set permissions correctly!"); - } - -# endif /* XXX XXX XXX */ - -# endif /* SAFE_SETUID */ - -#endif /* SET_UID */ - - -#ifdef SET_UID - /* Acquire the "user name" as a default player name */ user_name(player_name, player_uid); @@ -333,8 +293,6 @@ int main(int argc, char *argv[]) if (ret == FALSE) quit("Cannot create directory " PRIVATE_USER_PATH); } -#endif /* SET_UID */ - |