forked from qt-creator/qt-creator
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:
@@ -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 << " ********";
|
||||
|
Reference in New Issue
Block a user