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 3ab73ad..aa928c7 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2907,6 +2907,7 @@ public HiveConf(HiveConf other) { isSparkConfigUpdated = other.isSparkConfigUpdated; 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 ced454f..2b3fdf1 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 @@ -1854,7 +1854,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();