aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2020-10-15 17:07:00 +0200
committerChristian Kandeler <[email protected]>2020-10-16 10:40:45 +0000
commitdd62254e4e5c1d56861a915da8c1484539860b1f (patch)
tree28aa17ad1f2ceea39dfccfe3a1084a18fbdcaed1 /src/shared
parentd1b0c12d6b6c4698492851716b3931bc9cae5fd3 (diff)
QmakeProjectManager: Make "system" execution opt-in
It has too many side effects. Amends fcd6384f4d. T_SYSTEM and E_SYSTEM are now treated the same. Fixes: QTCREATORBUG-24551 Change-Id: Ib6df2762d329f2ddc0dd66190454159d446a9ac9 Reviewed-by: Joerg Bornemann <[email protected]>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/proparser/qmakebuiltins.cpp8
-rw-r--r--src/shared/proparser/qmakeglobals.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp
index c74ff4faf0d..9288d9e8876 100644
--- a/src/shared/proparser/qmakebuiltins.cpp
+++ b/src/shared/proparser/qmakebuiltins.cpp
@@ -931,8 +931,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
else if (!m_tmp2.compare(QLatin1String("lines"), Qt::CaseInsensitive))
lines = true;
}
- int exitCode;
- QByteArray bytes = getCommandOutput(args.at(0).toQString(), &exitCode);
+ int exitCode = 0;
+ QByteArray bytes;
+ if (m_option->runSystemFunction)
+ bytes = getCommandOutput(args.at(0).toQString(), &exitCode);
if (args.count() > 2 && !args.at(2).isEmpty()) {
m_valuemapStack.top()[args.at(2).toKey()] =
ProStringList(ProString(QString::number(exitCode)));
@@ -1778,6 +1780,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
evalError(fL1S("system(exec) requires one argument."));
return ReturnFalse;
}
+ if (!m_option->runSystemFunction)
+ return ReturnTrue;
if (m_cumulative) // Anything else would be insanity
return ReturnFalse;
#ifndef QT_BOOTSTRAPPED
diff --git a/src/shared/proparser/qmakeglobals.h b/src/shared/proparser/qmakeglobals.h
index 96e22992140..c8efbb22529 100644
--- a/src/shared/proparser/qmakeglobals.h
+++ b/src/shared/proparser/qmakeglobals.h
@@ -110,6 +110,7 @@ public:
QString qmakespec, xqmakespec;
QString user_template, user_template_prefix;
QString extra_cmds[4];
+ bool runSystemFunction = false;
#ifdef PROEVALUATOR_DEBUG
int debugLevel;