forked from qt-creator/qt-creator
Debugger: Pass runAsRoot to terminal applications
Fixes: QTCREATORBUG-27519 Change-Id: I66478b5e68aee55c929fe2b7785973b8e7167fbf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -172,9 +173,18 @@ void TerminalRunner::start()
|
||||
QTC_ASSERT(!m_stubProc, reportFailure({}); return);
|
||||
Runnable stub = m_stubRunnable();
|
||||
|
||||
bool runAsRoot = false;
|
||||
if (auto runAsRootAspect = runControl()->aspect<RunAsRootAspect>())
|
||||
runAsRoot = runAsRootAspect->value;
|
||||
|
||||
m_stubProc = new Process(this);
|
||||
m_stubProc->setTerminalMode(TerminalMode::Debug);
|
||||
|
||||
if (runAsRoot) {
|
||||
m_stubProc->setRunAsRoot(runAsRoot);
|
||||
RunControl::provideAskPassEntry(stub.environment);
|
||||
}
|
||||
|
||||
connect(m_stubProc, &Process::started,
|
||||
this, &TerminalRunner::stubStarted);
|
||||
connect(m_stubProc, &Process::done,
|
||||
|
||||
Reference in New Issue
Block a user