summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-11-02 11:13:18 +0100
committerPetr Mrázek <peterix@gmail.com>2014-11-02 11:13:18 +0100
commitc1b6f42551f0d324f7649c78b33ba7086e2b4905 (patch)
tree0702cf6e36d021dd2192dca3e7d59089be346b08
parent3d1426b5592794160188878927ff2eefc56b0211 (diff)
downloadMultiMC-c1b6f42551f0d324f7649c78b33ba7086e2b4905.tar
MultiMC-c1b6f42551f0d324f7649c78b33ba7086e2b4905.tar.gz
MultiMC-c1b6f42551f0d324f7649c78b33ba7086e2b4905.tar.lz
MultiMC-c1b6f42551f0d324f7649c78b33ba7086e2b4905.tar.xz
MultiMC-c1b6f42551f0d324f7649c78b33ba7086e2b4905.zip
Also block other java-related env vars, for good measure
"JAVA_ARGS" "CLASSPATH" "CONFIGPATH" "JAVA_HOME" "JRE_HOME"
-rw-r--r--logic/MinecraftProcess.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/logic/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp
index 71bf34c7..e1264abf 100644
--- a/logic/MinecraftProcess.cpp
+++ b/logic/MinecraftProcess.cpp
@@ -44,9 +44,17 @@ MinecraftProcess::MinecraftProcess(InstancePtr inst) : m_instance(inst)
QProcessEnvironment rawenv = QProcessEnvironment::systemEnvironment();
QProcessEnvironment env;
+
+ QStringList ignored = {"JAVA_ARGS", "CLASSPATH", "CONFIGPATH", "JAVA_HOME", "JRE_HOME"};
for(auto key: rawenv.keys())
{
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
if(key.startsWith("QT_"))
{