drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vita...@apache.org
Subject [2/5] drill git commit: DRILL-6250: Sqlline start command with password appears in the sqlline.log
Date Tue, 20 Mar 2018 20:58:07 GMT
DRILL-6250: Sqlline start command with password appears in the sqlline.log

closes #1174


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/edc982a9
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/edc982a9
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/edc982a9

Branch: refs/heads/master
Commit: edc982a90f3551d1e30ec210f18d87ec4c084b70
Parents: 4e3e0ff
Author: Vladimir Tkach <vovatkach75@gmail.com>
Authored: Sat Mar 17 17:27:10 2018 +0200
Committer: Vitalii Diravka <vitalii.diravka@gmail.com>
Committed: Tue Mar 20 22:33:34 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/drill/common/config/DrillConfig.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/edc982a9/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/config/DrillConfig.java b/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
index 73c899d..0d5c881 100644
--- a/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
+++ b/common/src/main/java/org/apache/drill/common/config/DrillConfig.java
@@ -52,8 +52,10 @@ public class DrillConfig extends NestedConfig {
   public DrillConfig(Config config) {
     super(config);
     logger.debug("Setting up DrillConfig object.");
-    logger.trace("Given Config object is:\n{}",
-                 config.root().render(ConfigRenderOptions.defaults()));
+    // we need to exclude sun.java.command config node while logging, because
+    // it contains user password along with other parameters
+    logger.trace("Given Config object is:\n{}", config.withoutPath("password").withoutPath("sun.java.command")
+                 .root().render(ConfigRenderOptions.defaults()));
     RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
     this.startupArguments = ImmutableList.copyOf(bean.getInputArguments());
     logger.debug("DrillConfig object initialized.");
@@ -239,7 +241,9 @@ public class DrillConfig extends NestedConfig {
     if (overriderProps != null) {
       logString.append("Overridden Properties:\n");
       for(Entry<Object, Object> entry : overriderProps.entrySet()){
-        logString.append("\t-").append(entry.getKey()).append(" = ").append(entry.getValue()).append("\n");
+        if (!entry.getKey().equals("password")) {
+          logString.append("\t-").append(entry.getKey()).append(" = ").append(entry.getValue()).append("\n");
+        }
       }
       logString.append("\n");
       effectiveConfig =


Mime
View raw message