forked from qt-creator/qt-creator
Fix running as root
There is no need for TerminalRunner::setRunAsRoot() as debugger is already being run as root. Implement runAsRoot for non-terminal QtcProcess, too. Fixes: QTCREATORBUG-26964 Change-Id: Id5110db86b7b809a5608714464241cee73875f2b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -3852,12 +3852,9 @@ void GdbEngine::setupEngine()
|
||||
|
||||
Environment gdbEnv = rp.debugger.environment;
|
||||
gdbEnv.setupEnglishOutput();
|
||||
if (rp.runAsRoot) {
|
||||
CommandLine wrapped("sudo", {"-A"});
|
||||
wrapped.addCommandLineAsArgs(gdbCommand);
|
||||
gdbCommand = wrapped;
|
||||
if (rp.runAsRoot)
|
||||
RunControl::provideAskPassEntry(gdbEnv);
|
||||
}
|
||||
m_gdbProc.setRunAsRoot(rp.runAsRoot);
|
||||
|
||||
showMessage("STARTING " + gdbCommand.toUserOutput());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user