From f4b7faff18e02bcac4a770cd230b5c461859a3b1 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 23 May 2022 10:36:22 +0200 Subject: [PATCH] Re-enable 'Run as Root' Accidentally dropped in b05fc053ef0835. Change-Id: I4cc9da1057ae9e19d3efd3b1d9482b18b7d847df Reviewed-by: Jarek Kobus --- src/plugins/projectexplorer/runcontrol.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index f3bb8b3c474..6aab33f33f6 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1216,6 +1216,10 @@ void SimpleTargetRunner::doStart(const Runnable &runnable) if (auto runAsRootAspect = runControl()->aspect()) runAsRoot = runAsRootAspect->value; + Environment env = runnable.environment; + if (runAsRoot) + RunControl::provideAskPassEntry(env); + m_stopForced = false; m_stopReported = false; m_launcher.disconnect(this); @@ -1225,7 +1229,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable) m_launcher.setCommand(runnable.command); m_launcher.setWorkingDirectory(runnable.workingDirectory); - m_launcher.setEnvironment(runnable.environment); + m_launcher.setEnvironment(env); m_launcher.setExtraData(runnable.extraData); const QString msg = RunControl::tr("Starting %1...").arg(runnable.command.toUserOutput());