diff --git a/hsarback/src/de/hsadmin/core/qserv/JDBCProcessor.java b/hsarback/src/de/hsadmin/core/qserv/JDBCProcessor.java index 8ec1b94..a570d14 100644 --- a/hsarback/src/de/hsadmin/core/qserv/JDBCProcessor.java +++ b/hsarback/src/de/hsadmin/core/qserv/JDBCProcessor.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.logging.Logger; import de.hsadmin.core.util.Config; +import de.hsadmin.core.util.TextUtil; public class JDBCProcessor extends AbstractProcessor { @@ -48,7 +49,7 @@ public class JDBCProcessor extends AbstractProcessor { throw new ProcessorException("database admin-user configuration failed"); } } - LOG.info("process() - DB-User: " + user + " Password: " + password); + LOG.info("process() - DB-User: " + user + " Password: " + TextUtil.hidePassword(password)); try { Class.forName(driver); c = DriverManager.getConnection(url, user, password); diff --git a/hsarback/src/de/hsadmin/core/util/TextUtil.java b/hsarback/src/de/hsadmin/core/util/TextUtil.java index 3f65d8f..55b953f 100644 --- a/hsarback/src/de/hsadmin/core/util/TextUtil.java +++ b/hsarback/src/de/hsadmin/core/util/TextUtil.java @@ -76,4 +76,12 @@ public class TextUtil { return parsedValue; } + public static synchronized String hidePassword(String passwd) { + StringBuffer val = new StringBuffer(passwd.substring(0, 2)); + for (int i = 2; i < passwd.length(); i++) { + val.append('*'); + } + return val.toString(); + } + }