OSDN Git Service

[Refactor] #37353 SECURE のプリプロを削除 / Removed preprocessor SECURE
authorHourier <hourier@users.sourceforge.jp>
Sun, 26 Jan 2020 14:00:32 +0000 (23:00 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 26 Jan 2020 14:00:32 +0000 (23:00 +0900)
src/floor-save.c
src/h-config.h
src/main.c
src/save.c
src/util.h

index 477d736..30ebc53 100644 (file)
@@ -74,14 +74,6 @@ void init_saved_floors(player_type *creature_ptr, bool force)
        int i;
        int fd = -1;
        BIT_FLAGS mode = 0644;
-
-#ifdef SET_UID
-# ifdef SECURE
-       /* Get "games" permissions */
-       beGames();
-# endif
-#endif
-
        for (i = 0; i < MAX_SAVED_FLOORS; i++)
        {
                saved_floor_type *sf_ptr = &saved_floors[i];
@@ -144,13 +136,6 @@ void init_saved_floors(player_type *creature_ptr, bool force)
 
        /* No change floor mode yet */
        creature_ptr->change_floor_mode = 0;
-
-#ifdef SET_UID
-# ifdef SECURE
-       /* Drop "games" permissions */
-       bePlayer();
-# endif
-#endif
 }
 
 /*!
@@ -163,14 +148,6 @@ void clear_saved_floor_files(player_type *creature_ptr)
 {
        char floor_savefile[1024];
        int i;
-
-#ifdef SET_UID
-# ifdef SECURE
-       /* Get "games" permissions */
-       beGames();
-# endif
-#endif
-
        for (i = 0; i < MAX_SAVED_FLOORS; i++)
        {
                saved_floor_type *sf_ptr = &saved_floors[i];
@@ -191,13 +168,6 @@ void clear_saved_floor_files(player_type *creature_ptr)
                /* Drop permissions */
                safe_setuid_drop();
        }
-
-#ifdef SET_UID
-# ifdef SECURE
-       /* Drop "games" permissions */
-       bePlayer();
-# endif
-#endif
 }
 
 /*!
index 5c0c4f4..7ef2cb0 100644 (file)
 
 
 /*
- * OPTION: for the AFS distributed file system, define this to ensure that
- * the program is secure with respect to the setuid code.  This option has
- * not been tested (to the best of my knowledge).  This option may require
- * some weird tricks with "player_uid" and such involving "defines".
- * Note that this option used the AFS library routines Authenticate(),
- * bePlayer(), beGames() to enforce the proper priviledges.
- * You may need to turn "SAFE_SETUID" off to use this option.
- */
-/* #define SECURE */
-
-
-/*
  * OPTION: Forbid the use of "fiddled" savefiles.  As far as I can tell,
  * a fiddled savefile is one with an internal timestamp different from
  * the actual timestamp.  Thus, turning this option on forbids one from
index 2c5c95b..4019480 100644 (file)
@@ -278,11 +278,6 @@ int main(int argc, char *argv[])
        /* Default permissions on files */
        (void)umask(022);
 
-# ifdef SECURE
-       /* Authenticate */
-       Authenticate();
-# endif
-
 #endif
 
 
index 6551aa5..c8c2cbf 100644 (file)
@@ -1489,17 +1489,6 @@ static bool save_player_aux(player_type *player_ptr, char *name)
  */
 bool save_player(player_type *player_ptr)
 {
-#ifdef SET_UID
-
-# ifdef SECURE
-
-       /* Get "games" permissions */
-       beGames();
-
-# endif
-
-#endif
-
        char safe[1024];
        strcpy(safe, savefile);
        strcat(safe, ".new");
@@ -1563,19 +1552,7 @@ bool save_player(player_type *player_ptr)
 
                /* Success */
                result = TRUE;
-}
-
-
-#ifdef SET_UID
-
-# ifdef SECURE
-
-       /* Drop "games" permissions */
-       bePlayer();
-
-# endif
-
-#endif
+       }
 
        /* Return the result */
        return result;
@@ -1845,15 +1822,6 @@ void remove_loc(void)
        char temp[1024];
 #endif /* VERIFY_SAVEFILE */
 
-#ifdef SET_UID
-# ifdef SECURE
-
-       /* Get "games" permissions */
-       beGames();
-
-# endif /* SECURE */
-#endif /* SET_UID */
-
 #ifdef VERIFY_SAVEFILE
 
        /* Lock on savefile */
@@ -1864,16 +1832,6 @@ void remove_loc(void)
        fd_kill(temp);
 
 #endif /* VERIFY_SAVEFILE */
-
-#ifdef SET_UID
-# ifdef SECURE
-
-       /* Drop "games" permissions */
-       bePlayer();
-
-# endif /* SECURE */
-#endif /* SET_UID */
-
 }
 
 
@@ -1934,12 +1892,6 @@ bool save_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mod
        char floor_savefile[1024];
        if (!(mode & SLF_SECOND))
        {
-#ifdef SET_UID
-# ifdef SECURE
-               /* Get "games" permissions */
-               beGames();
-# endif
-#endif
        }
 
        /* We have one file already opened */
@@ -2021,12 +1973,6 @@ bool save_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mod
 
        if (!(mode & SLF_SECOND))
        {
-#ifdef SET_UID
-# ifdef SECURE
-               /* Drop "games" permissions */
-               bePlayer();
-# endif
-#endif
        }
 
        /* We have one file already opened */
index c8c09f3..909b383 100644 (file)
 #define KTRL(X)        ((X) & 0x1F)
 #define ESCAPE '\033'
 
- /*
-  * Hack -- Prepare to use the "Secure" routines
-  */
-#if defined(SET_UID) && defined(SECURE)
-extern int PlayerUID;
-# define getuid() PlayerUID
-# define geteuid() PlayerUID
-#endif
-
 #define KEYMAP_MODE_ORIG       0 /*!< オリジナルキー配置 / Mode for original keyset commands */
 #define KEYMAP_MODE_ROGUE      1 /*!< ローグライクキー配置 / Mode for roguelike keyset commands */
 #define KEYMAP_MODES           2 /*!< キー配置の数 / Number of keymap modes */