Also block other java-related env vars, for good measure
"JAVA_ARGS" "CLASSPATH" "CONFIGPATH" "JAVA_HOME" "JRE_HOME"
This commit is contained in:
parent
3d1426b559
commit
c1b6f42551
@ -44,9 +44,17 @@ MinecraftProcess::MinecraftProcess(InstancePtr inst) : m_instance(inst)
|
|||||||
QProcessEnvironment rawenv = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment rawenv = QProcessEnvironment::systemEnvironment();
|
||||||
|
|
||||||
QProcessEnvironment env;
|
QProcessEnvironment env;
|
||||||
|
|
||||||
|
QStringList ignored = {"JAVA_ARGS", "CLASSPATH", "CONFIGPATH", "JAVA_HOME", "JRE_HOME"};
|
||||||
for(auto key: rawenv.keys())
|
for(auto key: rawenv.keys())
|
||||||
{
|
{
|
||||||
auto value = rawenv.value(key);
|
auto value = rawenv.value(key);
|
||||||
|
// filter out dangerous java crap
|
||||||
|
if(ignored.contains(key))
|
||||||
|
{
|
||||||
|
QLOG_INFO() << "Env: ignoring" << key << value;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// filter MultiMC-related things
|
// filter MultiMC-related things
|
||||||
if(key.startsWith("QT_"))
|
if(key.startsWith("QT_"))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user