fix: don't annoy when java tmpdir jvmarg is set & /tmp is noexec

Signed-off-by: Mason Rocha <mrocha@turretllc.us>

Got annoyed, didn't want to see it anymore.

Java tmpdir noexec warning modified to include information about
possible remedies available
This commit is contained in:
Mason Rocha 2024-09-27 16:42:59 -05:00
parent b9a6c13d47
commit b9c19fd3f7
No known key found for this signature in database
GPG Key ID: A829E5EE36EE33F1

View File

@ -1025,7 +1025,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
} }
// notify user if /tmp is mounted with `noexec` (#1693) // 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; bool is_tmp_noexec = false;
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
@ -1045,7 +1046,11 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
if (is_tmp_noexec) { if (is_tmp_noexec) {
auto infoMsg = auto infoMsg =
tr("Your /tmp directory is currently mounted with the 'noexec' flag enabled.\n" 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); auto msgBox = new QMessageBox(QMessageBox::Information, tr("Incompatible system configuration"), infoMsg, QMessageBox::Ok);
msgBox->setDefaultButton(QMessageBox::Ok); msgBox->setDefaultButton(QMessageBox::Ok);
msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setAttribute(Qt::WA_DeleteOnClose);