Don't pass full command line to exitMessage()

Amends 00b692e67e

SynchronousProcessResponse::exitMessage() takes only
the executable as first parameter. Passing a whole
command line there has two disadvantages:

1. Sensible data (like passwords) that needs to be obfuscated
   is shown as plain text in the output pane.
2. Forward slashes like in "refs/for/master" are converted
   to backslashes on Windows.

While the second case could be fixed with an overload
of CommandLine to exitMessage, the first point probably
needs more work at several places.

So let's just remove the arguments, like it was in Creator versions
before 00b692e67e

Fixes: QTCREATORBUG-24153
Change-Id: I546f7238347466eac089ba3e7f74201c2be40d39
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-06-10 16:51:17 +02:00
committed by André Hartmann
parent 5fcbc55c2c
commit b059095f3f

View File

@@ -347,9 +347,9 @@ SynchronousProcessResponse ShellCommand::runCommand(const CommandLine &command,
// Success/Fail message in appropriate window?
if (response.result == SynchronousProcessResponse::Finished) {
if (d->m_flags & ShowSuccessMessage)
emit proxy->appendMessage(response.exitMessage(command.toUserOutput(), timeoutS));
emit proxy->appendMessage(response.exitMessage(command.executable().toUserOutput(), timeoutS));
} else if (!(d->m_flags & SuppressFailMessage)) {
emit proxy->appendError(response.exitMessage(command.toUserOutput(), timeoutS));
emit proxy->appendError(response.exitMessage(command.executable().toUserOutput(), timeoutS));
}
}