VcsOutputWindow: Try harder to filter out password data

Not perfect, but might catch some more passwords before they are
echoed in cleartext.

Change-Id: I61e537a4a3cbc69748e1f761a5a08fe03ff2552d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-01-20 12:16:13 +01:00
parent b86aea44c2
commit 38ef30f4c2

View File

@@ -441,9 +441,13 @@ static inline QString formatArguments(const QStringList &args)
const int size = args.size();
// Skip authentication options
for (int i = 0; i < size; i++) {
const QString &arg = args.at(i);
const QString arg = filterPasswordFromUrls(args.at(i));
if (i)
str << ' ';
if (arg.startsWith(QString::fromLatin1(passwordOptionC) + QLatin1Char('='))) {
str << "--password=********";
continue;
}
str << arg;
if (arg == QLatin1String(passwordOptionC)) {
str << " ********";