NOISSUE prevent -version being passed to the JRE
We want specific JREs, always, not something that is magically resolved. This counteracts some really bad advice recently being spread on reddit.
This commit is contained in:
parent
cc5261051f
commit
566a83b245
@ -17,6 +17,17 @@ bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent)
|
|||||||
QMessageBox::Warning)->exec();
|
QMessageBox::Warning)->exec();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// block lunacy with passing required version to the JVM
|
||||||
|
if (jvmargs.contains(QRegExp("-version:.*"))) {
|
||||||
|
auto warnStr = QObject::tr(
|
||||||
|
"You tried to pass required java version argument to the JVM (using \"-version=xxx\"). This is not safe and will not be allowed.\n"
|
||||||
|
"This message will be displayed until you remove this from the JVM arguments.");
|
||||||
|
CustomMessageBox::selectable(
|
||||||
|
parent, QObject::tr("JVM arguments warning"),
|
||||||
|
warnStr,
|
||||||
|
QMessageBox::Warning)->exec();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,10 @@ void LaunchController::executeTask()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget);
|
if(!JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget)) {
|
||||||
|
emitFailed(tr("Invalid Java arguments specified. Please fix this first."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
login();
|
login();
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,6 @@ void InstanceSettingsPage::applySettings()
|
|||||||
if(javaArgs)
|
if(javaArgs)
|
||||||
{
|
{
|
||||||
m_settings->set("JvmArgs", ui->jvmArgsTextBox->toPlainText().replace("\n", " "));
|
m_settings->set("JvmArgs", ui->jvmArgsTextBox->toPlainText().replace("\n", " "));
|
||||||
JavaCommon::checkJVMArgs(m_settings->get("JvmArgs").toString(), this->parentWidget());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user