From 027af46ce80b11e77b9d9a9ed842679a0eb6c4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Ar=C3=A8s?= Date: Fri, 2 Mar 2018 13:27:43 -0500 Subject: [PATCH] Revert partially "Trim multi-line arguments for task name and ssh_log" This reverts partially commit a0ae281aa9266e0a65555cc80d838fbef3839225. That commit prevent multi line arguments for ending up in the error_log, output of show-queue command and in sshd_log by trimming the multi line arguments. This commit reverts only the sshd_log part. The original motivation for the other commit was mainly for error_log and output of show-queue, same logic was applied to sshd_log for consistency reasons. Trimming the multi line from sshd_log was a mistake because we lose information that can be found no where else. Change-Id: Ib9e5bdd7a935a2a0c969deb0c0e557bef976d251 --- .../src/main/java/com/google/gerrit/sshd/SshLog.java | 7 +++---- 1 file changed, 3 insertions(+), 4 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 5d840f9217..dfd56f1f88 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 @@ -14,7 +14,6 @@ package com.google.gerrit.sshd; -import com.google.common.base.Joiner; import com.google.common.collect.ListMultimap; import com.google.common.collect.MultimapBuilder; import com.google.gerrit.audit.AuditService; @@ -283,9 +282,9 @@ class SshLog implements LifecycleListener { return "Command was already destroyed"; } StringBuilder commandName = new StringBuilder(dcmd.getCommandName()); - String[] trimmedArgs = dcmd.getTrimmedArguments(); - if (trimmedArgs != null) { - commandName.append(Joiner.on(".").join(trimmedArgs)); + String[] args = dcmd.getArguments(); + for (int i = 1; i < args.length; i++) { + commandName.append(".").append(args[i]); } return commandName.toString(); }