diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index e7398b2..151d300 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2432,6 +2432,7 @@ public HiveConf(HiveConf other) { auxJars = other.auxJars; origProp = (Properties)other.origProp.clone(); restrictList.addAll(other.restrictList); + hiddenSet.addAll(other.hiddenSet); modWhiteListPattern = other.modWhiteListPattern; } diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java index ad014dd..c326988 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java @@ -1737,7 +1737,15 @@ public void testSetCommand() throws SQLException { assertEquals(SET_COLUMN_NAME, md.getColumnLabel(1)); //check if there is data in the resultset - assertTrue("Nothing returned by set -v", res.next()); + int numLines = 0; + while (res.next()){ + numLines++; + String rline = res.getString(1); + assertFalse("set output must not contain hidden variables such as the metastore password:"+rline, + rline.contains(HiveConf.ConfVars.METASTOREPWD.varname) && !(rline.contains(HiveConf.ConfVars.HIVE_CONF_HIDDEN_LIST.varname))); + // the only conf allowed to have the metastore pwd keyname is the hidden list configuration value + } + assertTrue("Nothing returned by set -v", numLines > 0); res.close(); stmt.close();