# define SAFE_SETUID_POSIX
#endif
-
-/*
- * OPTION: Forbid the "savefile over-write" cheat, in which you simply
- * run another copy of the game, loading a previously saved savefile,
- * and let that copy over-write the "dead" savefile later. This option
- * either locks the savefile, or creates a fake "xxx.lok" file to prevent
- * the use of the savefile until the file is deleted. Not ready yet.
- */
-/* #define VERIFY_SAVEFILE */
-
/*
* OPTION: Handle signals
*/
* React to the "VERIFY_HONOR" flag
*/
#ifdef VERIFY_HONOR
-# define VERIFY_SAVEFILE
#endif
#ifndef HAVE_CONFIG_H
break;
}
-#ifdef VERIFY_SAVEFILE
-
- case 'b':
- case 'd':
- case 'e':
- case 's':
- {
- quit_fmt("Restricted option '-d%s'", info);
- }
-
-#else /* VERIFY_SAVEFILE */
-
case 'b':
{
string_free(ANGBAND_DIR_BONE);
break;
}
-#endif /* VERIFY_SAVEFILE */
-
default:
{
quit_fmt("Bad semantics in '-d%s'", info);
/* Hack -- Pretend the character was loaded */
current_world_ptr->character_loaded = TRUE;
-#ifdef VERIFY_SAVEFILE
-
- /* Lock on savefile */
- strcpy(temp, savefile);
- strcat(temp, ".lok");
-
- /* Grab permissions */
- safe_setuid_grab();
-
- /* Remove lock file */
- fd_kill(temp);
-
- /* Drop permissions */
- safe_setuid_drop();
-
-#endif
-
- /* Success */
result = TRUE;
}
#endif
errr err = 0;
-#ifdef VERIFY_SAVEFILE
-
- /* Verify savefile usage */
- if (!err)
- {
- FILE *fkk;
-
- char temp[1024];
-
- /* Extract name of lock file */
- strcpy(temp, savefile);
- strcat(temp, ".lok");
-
- /* Check for lock */
- fkk = my_fopen(temp, "r");
-
- /* Oops, lock exists */
- if (fkk)
- {
- my_fclose(fkk);
-
- msg_print(_("セーブファイルは現在使用中です。", "Savefile is currently in use."));
- msg_print(NULL);
-
- return FALSE;
- }
-
- /* Create a lock file */
- fkk = my_fopen(temp, "w");
-
- /* Dump a line of info */
- fprintf(fkk, "Lock file for savefile '%s'\n", savefile);
-
- /* Close the lock file */
- my_fclose(fkk);
- }
-
-#endif
-
int fd = -1;
byte vvv[4];
if (!err)
return TRUE;
}
-#ifdef VERIFY_SAVEFILE
-
- /* Verify savefile usage */
- if (TRUE)
- {
- char temp[1024];
-
- /* Extract name of lock file */
- strcpy(temp, savefile);
- strcat(temp, ".lok");
-
- /* Remove lock */
- fd_kill(temp);
- }
-
-#endif
-
msg_format(_("エラー(%s)がバージョン%d.%d.%d 用セーブファイル読み込み中に発生。", "Error (%s) reading %d.%d.%d savefile."),
what, (current_world_ptr->z_major > 9) ? current_world_ptr->z_major - 10 : current_world_ptr->z_major, current_world_ptr->z_minor, current_world_ptr->z_patch);
msg_print(NULL);
*/
void remove_loc(void)
{
-#ifdef VERIFY_SAVEFILE
- char temp[1024];
-#endif /* VERIFY_SAVEFILE */
-
-#ifdef VERIFY_SAVEFILE
-
- /* Lock on savefile */
- strcpy(temp, savefile);
- strcat(temp, ".lok");
-
- /* Remove lock file */
- fd_kill(temp);
-
-#endif /* VERIFY_SAVEFILE */
}