mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Set file permissions when downloading installer on Linux
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user