Prevent access to /Save/Preferences.ini from lua

Directly writing to the file would circumvent preference protections,
compromising security.
This commit is contained in:
Martin Natano
2022-05-07 23:53:58 +02:00
parent b9ebbd32a9
commit d54bc6857f
4 changed files with 71 additions and 59 deletions
+3
View File
@@ -1002,6 +1002,9 @@ int sm_main(int argc, char* argv[])
// Almost everything uses this to read and write files. Load this early.
FILEMAN = new RageFileManager( argv[0] );
FILEMAN->ProtectPath(SpecialFiles::DEFAULTS_INI_PATH);
FILEMAN->ProtectPath(SpecialFiles::STATIC_INI_PATH);
FILEMAN->ProtectPath(SpecialFiles::PREFERENCES_INI_PATH);
FILEMAN->MountInitialFilesystems();
bool bPortable = DoesFileExist("/Portable.ini");