Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
KPMCore
Commits
4fa91d75
Commit
4fa91d75
authored
Nov 26, 2020
by
Andrius Štikonas
Browse files
externalcommandhelper: Do not commit suicide when attempting to run non whitelisted command.
Simply returning failure should be sufficient.
parent
32d146ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/util/externalcommandhelper.cpp
View file @
4fa91d75
...
...
@@ -288,7 +288,6 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr
QString
basename
=
command
.
mid
(
command
.
lastIndexOf
(
QLatin1Char
(
'/'
))
+
1
);
if
(
std
::
find
(
std
::
begin
(
allowedCommands
),
std
::
end
(
allowedCommands
),
basename
)
==
std
::
end
(
allowedCommands
))
{
qInfo
()
<<
command
<<
" command is not one of the whitelisted command"
;
qApp
->
quit
();
reply
[
QStringLiteral
(
"success"
)]
=
false
;
return
reply
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment