瀏覽代碼

AMBARI-14105 Oozie/Hive "Database User" field validation missed. (ababiichuk)

aBabiichuk 9 年之前
父節點
當前提交
5becb314e9

+ 1 - 0
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml

@@ -69,6 +69,7 @@ limitations under the License.
     <display-name>Database Username</display-name>
     <display-name>Database Username</display-name>
     <description>username to use against metastore database</description>
     <description>username to use against metastore database</description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 1 - 0
ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/configuration/oozie-site.xml

@@ -227,6 +227,7 @@
       Database user name to use to connect to the database
       Database user name to use to connect to the database
     </description>
     </description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 1 - 0
ambari-server/src/main/resources/common-services/OOZIE/4.2.0.2.3/configuration/oozie-site.xml

@@ -108,6 +108,7 @@
       Database user name to use to connect to the database
       Database user name to use to connect to the database
     </description>
     </description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml

@@ -67,6 +67,7 @@ limitations under the License.
     <display-name>Database Username</display-name>
     <display-name>Database Username</display-name>
     <description>username to use against metastore database</description>
     <description>username to use against metastore database</description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/2.1/services/OOZIE/configuration/oozie-site.xml

@@ -226,6 +226,7 @@
       Database user name to use to connect to the database
       Database user name to use to connect to the database
     </description>
     </description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml

@@ -436,6 +436,7 @@ limitations under the License.
     <display-name>Database Username</display-name>
     <display-name>Database Username</display-name>
     <description>username to use against metastore database</description>
     <description>username to use against metastore database</description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 1 - 0
ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/HIVE/configuration/hive-site.xml

@@ -404,6 +404,7 @@ limitations under the License.
     <display-name>Database Username</display-name>
     <display-name>Database Username</display-name>
     <description>username to use against metastore database</description>
     <description>username to use against metastore database</description>
     <value-attributes>
     <value-attributes>
+      <type>db_user</type>
       <overridable>false</overridable>
       <overridable>false</overridable>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 2 - 6
ambari-web/app/models/configs/objects/service_config_property.js

@@ -430,14 +430,10 @@ App.ServiceConfigProperty = Em.Object.extend({
           }
           }
           break;
           break;
         case 'user':
         case 'user':
-          if (!validator.isValidUNIXUser(value)){
-            this.set('errorMessage', 'Username is not valid');
-            isError = true;
-          }
-          break;
         case 'database':
         case 'database':
+        case 'db_user':
           if (!validator.isValidDbName(value)){
           if (!validator.isValidDbName(value)){
-            this.set('errorMessage', 'Database is not valid');
+            this.set('errorMessage', 'Value is not valid');
             isError = true;
             isError = true;
           }
           }
           break;
           break;