mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Prevent games from setting secure settings (#10460)
This commit is contained in:
@@ -34,12 +34,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// The maximum number of identical world names allowed
|
||||
#define MAX_WORLD_NAMES 100
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
bool getGameMinetestConfig(const std::string &game_path, Settings &conf)
|
||||
{
|
||||
std::string conf_path = game_path + DIR_DELIM + "minetest.conf";
|
||||
return conf.readConfigFile(conf_path.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct GameFindPath
|
||||
{
|
||||
std::string path;
|
||||
@@ -330,8 +335,11 @@ void loadGameConfAndInitWorld(const std::string &path, const std::string &name,
|
||||
// files that were loaded before.
|
||||
g_settings->clearDefaults();
|
||||
set_default_settings(g_settings);
|
||||
|
||||
Settings game_defaults;
|
||||
getGameMinetestConfig(gamespec.path, game_defaults);
|
||||
game_defaults.removeSecureSettings();
|
||||
|
||||
g_settings->overrideDefaults(&game_defaults);
|
||||
|
||||
infostream << "Initializing world at " << final_path << std::endl;
|
||||
|
Reference in New Issue
Block a user