Permalink
Browse files

Make sure people are not trying to sneak invisible characters on the …

…kdesu label

i18n: Sorry for the new string

CCMAIL: kde-i18n-doc@kde.org
  • Loading branch information...
sandsmark authored and tsdgeos committed Sep 9, 2016
1 parent f24fb29 commit 5eda179a099ba68a20dc21dc0da63e85a565a171
Showing with 10 additions and 0 deletions.
  1. +10 −0 kdesu/kdesu.cpp
View
@@ -162,6 +162,10 @@ int main(int argc, char *argv[])
{
KMessageBox::sorry(0, i18n("Cannot execute command '%1'.", QString::fromLocal8Bit(command)));
}
if (result == -2)
{
KMessageBox::sorry(0, i18n("Cannot execute command '%1'. It contains invalid characters.", QString::fromLocal8Bit(command)));
}
return result;
}
@@ -387,6 +391,12 @@ static int startApp(QCommandLineParser& p)
qDebug() << "Don't need password!!\n";
}
for (const QChar character : QString::fromLocal8Bit(command)) {
if (!character.isPrint() && character.category() != QChar::Other_Surrogate) {
return -2;
}
}
// Start the dialog
QString password;
if (needpw)

0 comments on commit 5eda179

Please sign in to comment.