Notify user when they enter non whitelisted command

Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21504
This commit is contained in:
Shubham Jangra 2019-05-30 22:36:06 +05:30
parent 39ab428f0c
commit 68cf1efd6b
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ QVariantMap ExternalCommandHelper::start(const QString& command, const QStringLi
// Compare with command whitelist
QString basename = command.mid(command.lastIndexOf(QLatin1Char('/')) + 1);
if (std::find(std::begin(allowedCommands), std::end(allowedCommands), basename) == std::end(allowedCommands)) {
// TODO: notify the user
qInfo() << command <<" command is not one of the whitelisted command";
m_loop->exit();
reply[QStringLiteral("success")] = false;
return reply;