From d4b7b9dd40783d7bb0c1f20d7ef6c8104f7b572e Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Wed, 19 Aug 2020 17:32:46 +0100 Subject: [PATCH] Set file permissions when downloading installer on Linux --- src/blackgui/components/downloadcomponent.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/blackgui/components/downloadcomponent.cpp b/src/blackgui/components/downloadcomponent.cpp index f9efbd30b..cd828b3df 100644 --- a/src/blackgui/components/downloadcomponent.cpp +++ b/src/blackgui/components/downloadcomponent.cpp @@ -295,7 +295,7 @@ namespace BlackGui for (const CRemoteFile &rf : executables) { const QString executable = CFileUtils::appendFilePaths(dir.absolutePath(), rf.getBaseName()); - const QFile executableFile(executable); + QFile executableFile(executable); if (!executableFile.exists()) { continue; } QMessageBox::StandardButton reply = QMessageBox::question(this, "Start?", msg.arg(rf.getName()), QMessageBox::Yes | QMessageBox::No); @@ -310,6 +310,12 @@ namespace BlackGui return; } + if (CBuildConfig::isRunningOnLinuxPlatform() && !executableFile.permissions().testFlag(QFile::ExeOwner)) + { + executableFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner + | QFile::ReadGroup | QFile::ExeGroup | QFile::ReadOther | QFile::ExeOther); + } + const bool shutdown = ui->cb_Shutdown->isChecked(); const bool started = QProcess::startDetached(executable, {}, dir.absolutePath()); if (started && shutdown && sGui)