jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1545872 - /jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java
Date Tue, 26 Nov 2013 22:30:10 GMT
Author: sebb
Date: Tue Nov 26 22:30:10 2013
New Revision: 1545872

URL: http://svn.apache.org/r1545872
Log:
Don't log password on failure; only quote parameters with spaces

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java?rev=1545872&r1=1545871&r2=1545872&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java Tue Nov 26 22:30:10
2013
@@ -179,11 +179,17 @@ public class KeyToolUtils {
      */
     private static String formatCommand(List<String> arguments) {
         StringBuilder builder = new StringBuilder();
+        boolean redact = false; // whether to redact next parameter
         for (String string : arguments) {
-            builder.append("\"").append(string).append("\"").append(" ");
+            final boolean quote = string.contains(" ");
+            if (quote) builder.append("\"");
+            builder.append(redact? "{redacted)" : string);
+            if (quote) builder.append("\"");
+            builder.append(" ");
+            redact = string.equals("-storepass") || string.equals("-keypass");
         }
         if(arguments.size()>0) {
-            builder.setLength(builder.length()-1);
+            builder.setLength(builder.length()-1); // trim trailing space
         }
         return builder.toString();
     }



Mime
View raw message