Merge pull request #2867 from turret-dev/turret/tmpdir_noexec_jvmarg_noannoy

fix: don't annoy when java tmpdir jvmarg is set & /tmp is noexec
This commit is contained in:
Tayou 2024-09-29 09:07:25 +02:00 committed by GitHub
commit a63451212f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1025,7 +1025,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
}
// notify user if /tmp is mounted with `noexec` (#1693)
{
QString jvmArgs = m_settings->get("JvmArgs").toString();
if(jvmArgs.indexOf("java.io.tmpdir") == -1) { /* java.io.tmpdir is a valid workaround, so don't annoy */
bool is_tmp_noexec = false;
#if defined(Q_OS_LINUX)
@ -1045,7 +1046,11 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
if (is_tmp_noexec) {
auto infoMsg =
tr("Your /tmp directory is currently mounted with the 'noexec' flag enabled.\n"
"Some versions of Minecraft may not launch.\n");
"Some versions of Minecraft may not launch.\n"
"\n"
"You may solve this issue by remounting /tmp as 'exec' or setting "
"the java.io.tmpdir JVM argument to a writeable directory in a "
"filesystem where the 'exec' flag is set (e.g., /home/user/.local/tmp)\n");
auto msgBox = new QMessageBox(QMessageBox::Information, tr("Incompatible system configuration"), infoMsg, QMessageBox::Ok);
msgBox->setDefaultButton(QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose);