You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2013/11/26 23:30:10 UTC
svn commit: r1545872 -
/jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java
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();
}