summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2011-04-18 20:37:31 +0200
committerBardur Arantsson <bardur@scientician.net>2012-03-29 20:57:29 +0200
commitb102a2e0aeb70e93a1122f42e00a7b672f718a07 (patch)
tree8b7cb08fe9c3251836e8f5a8b975eee452833366 /src/main.c
parent142e4467809aec4a8dfa5a1126d9cc1d5eea5ed3 (diff)
Refactor: Remove some dead setuid code.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/main.c b/src/main.c
index 0a3dbb9b..48ab3f04 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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 */
-