HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2017-09-19 b353e00b6cb494bd3dee9c4c55a0939a217153dc
do not log full password
2 files modified
11 ■■■■■ changed files
hsarback/src/de/hsadmin/core/qserv/JDBCProcessor.java 3 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/util/TextUtil.java 8 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/qserv/JDBCProcessor.java
@@ -9,6 +9,7 @@
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 @@
                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);
hsarback/src/de/hsadmin/core/util/TextUtil.java
@@ -76,4 +76,12 @@
        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();
    }
}