1
0
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:
rubenwardy
2020-10-06 12:10:37 +01:00
committed by GitHub
parent f46509d5e2
commit e80fc22dd9
4 changed files with 23 additions and 3 deletions

View File

@@ -1039,6 +1039,19 @@ void Settings::deregisterChangedCallback(const std::string &name,
}
}
void Settings::removeSecureSettings()
{
for (const auto &name : getNames()) {
if (name.compare(0, 7, "secure.") != 0)
continue;
errorstream << "Secure setting " << name
<< " isn't allowed, so was ignored."
<< std::endl;
remove(name);
}
}
void Settings::doCallbacks(const std::string &name) const
{
MutexAutoLock lock(m_callback_mutex);