From b9c19fd3f73877f80fb2363617d893f91e5037e2 Mon Sep 17 00:00:00 2001 From: Mason Rocha Date: Fri, 27 Sep 2024 16:42:59 -0500 Subject: [PATCH] fix: don't annoy when java tmpdir jvmarg is set & /tmp is noexec Signed-off-by: Mason Rocha Got annoyed, didn't want to see it anymore. Java tmpdir noexec warning modified to include information about possible remedies available --- launcher/Application.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 6379678c9..4a66271a3 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -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);