Przeglądaj źródła

AMBARI-6016 - On Exception, database connection password is printed to log

Artem Baranchuk 11 lat temu
rodzic
commit
a63f9e6dc4

+ 1 - 1
ambari-agent/src/main/python/resource_management/core/shell.py

@@ -86,7 +86,7 @@ def _call(command, logoutput=False, throw_on_failure=True,
     Logger.info(out)
   
   if throw_on_failure and code:
-    err_msg = ("Execution of '%s' returned %d. %s") % (command[-1], code, out)
+    err_msg = Logger.get_protected_text(("Execution of '%s' returned %d. %s") % (command[-1], code, out))
     raise Fail(err_msg)
   
   return code, out

+ 2 - 2
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py

@@ -96,13 +96,13 @@ def hive(name=None):
                                  "{hive_bin}/schematool -initSchema "
                                  "-dbType {hive_metastore_db_type} "
                                  "-userName {hive_metastore_user_name} "
-                                 "-passWord {hive_metastore_user_passwd}")
+                                 "-passWord {hive_metastore_user_passwd!p}")
 
       check_schema_created_cmd = format("export HIVE_CONF_DIR={hive_config_dir} ; "
                                         "{hive_bin}/schematool -info "
                                         "-dbType {hive_metastore_db_type} "
                                         "-userName {hive_metastore_user_name} "
-                                        "-passWord {hive_metastore_user_passwd}")
+                                        "-passWord {hive_metastore_user_passwd!p}")
 
       Execute(create_schema_cmd,
               not_if = check_schema_created_cmd