summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Beetle <ben.beetle@gmail.com>2014-10-20 17:23:05 -0400
committerBen Beetle <ben.beetle@gmail.com>2014-12-04 17:56:48 +0000
commit1f03f54a8247da940967abdc6cd06b0a233f5d82 (patch)
treea8c2378ffd22e36cde5a54abde76595e0c711eef
parentca4e1852e9f50334bc904de2b5e3647f6ff9ba7d (diff)
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 a56057f97620ae7b958c338149853d605d8d3604)
-rw-r--r--gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshLog.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshLog.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshLog.java
index 7df8db4c4a..fc80f5a9bb 100644
--- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshLog.java
+++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshLog.java
@@ -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;
}