Include all command arguments in SSH log entry

Previously the SSH log only included the first argument. This
prevented the repository name from being logged when
'git receive-pack' was executed instead of 'git-receive-pack'.

Now the SSH log includes all command arguments in the log ensuring
that the repository name is always logged. This is desirable behavior
for anyone looking to monitor repository access via the SSH log.

Change-Id: Idff950e5480a122a2cb366a443d25aa9e0a8f5c8
(cherry picked from commit a56057f976)
This commit is contained in:
Ben Beetle 2014-10-20 17:23:05 -04:00
parent ca4e1852e9
commit 1f03f54a82

View File

@ -269,9 +269,8 @@ class SshLog implements LifecycleListener {
private String extractWhat(DispatchCommand dcmd) {
String commandName = dcmd.getCommandName();
String[] args = dcmd.getArguments();
if (args.length > 1) {
return commandName + "." + args[1];
for (String arg : dcmd.getArguments()) {
commandName = commandName + "." + arg;
}
return commandName;
}