From 9a857659ce8c9bfcaf6277d569d1df6e14f25566 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 3 May 2021 15:48:31 +0400 Subject: [PATCH] Check action type before launching new version --- Telegram/SourceFiles/platform/linux/launcher_linux.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp index 3f8489502b..f358fbaec2 100644 --- a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp @@ -83,7 +83,7 @@ bool Launcher::launchUpdater(UpdaterLaunch action) { : (cExeDir() + qsl("Updater"))); auto argumentsList = Arguments(); - if (action != UpdaterLaunch::JustRelaunch && cWriteProtected()) { + if (action == UpdaterLaunch::PerformUpdate && cWriteProtected()) { argumentsList.push("pkexec"); } argumentsList.push(QFile::encodeName(binaryPath)); @@ -141,7 +141,7 @@ bool Launcher::launchUpdater(UpdaterLaunch action) { } // pkexec needs an alive parent - if (cWriteProtected()) { + if (action == UpdaterLaunch::PerformUpdate && cWriteProtected()) { waitpid(pid, nullptr, 0); // launch new version in the same environment return launchUpdater(UpdaterLaunch::JustRelaunch);