From 485ff3224322fe1b1618deca6e916ba6214aa571 Mon Sep 17 00:00:00 2001 From: Irena Goverdovsky Date: Mon, 6 Jul 2015 11:44:12 +0300 Subject: [PATCH] ESC-572/HHQ-6050 : Print *** instead of passwords. --- hq-util/src/main/java/org/hyperic/util/exec/Execute.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hq-util/src/main/java/org/hyperic/util/exec/Execute.java b/hq-util/src/main/java/org/hyperic/util/exec/Execute.java index 17dcb5d85c..995dc8e148 100644 --- a/hq-util/src/main/java/org/hyperic/util/exec/Execute.java +++ b/hq-util/src/main/java/org/hyperic/util/exec/Execute.java @@ -345,7 +345,9 @@ public int execute() throws Exception { int exit= getExitValue(); if( log.isDebugEnabled() ) { - log.debug("Done exit=" + exit + " " + getCommandLineString()); + // ESC-572/HHQ-6050 Irena: to avoid print password in debug messages. + log.debug("Done exit="+ exit + getCommandLineString().replaceAll("(-P,? ?)([^ ,]+)", "$1******").replaceAll("(pass[^=]*=)(\\w*)", "$1******")); + //log.debug("Done exit=" + exit + " " + getCommandLineString()); } return exit; }