You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vi...@apache.org on 2012/06/07 00:01:08 UTC

svn commit: r1347163 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/frontend/configUtils.php

Author: vikram
Date: Wed Jun  6 22:01:07 2012
New Revision: 1347163

URL: http://svn.apache.org/viewvc?rev=1347163&view=rev
Log:
AMBARI-388. Do not allow invalid chars for database name and user name for hive (Contributed by Hitesh)

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/php/frontend/configUtils.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347163&r1=1347162&r2=1347163&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Wed Jun  6 22:01:07 2012
@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-389. Do not allow invalid chars for database name and user name for hive (Hitesh via Vikram)
+
   AMBARI-388. Prevent the user from assigning NameNode and Secondary NameNode services on the same host (Yusaku via Vikram)
 
   AMBARI-386. On Single Node install when install all the components the recommended num for Map/Reduce Tasks is too high (Hitesh via Vikram)

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/configUtils.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/configUtils.php?rev=1347163&r1=1347162&r2=1347163&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/configUtils.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/configUtils.php Wed Jun  6 22:01:07 2012
@@ -89,10 +89,14 @@ function validateConfigs($svcConfigs) {
       } else if ($key == "hive_database_name") {
         if ($val == "") {
           $errors[$key] = array ( "error" => "Database name cannot be empty");
+        } else if (preg_match("/^\w+$/", $val) == 0) {
+          $errors[$key] = array ( "error" => "Database name should only contain alphanumeric characters");
         }
       } else if ($key == "hive_metastore_user_name") {
         if ($val == "") {
           $errors[$key] = array ( "error" => "Database user name cannot be empty");
+        } else if (preg_match("/^\w+$/", $val) == 0) {
+          $errors[$key] = array ( "error" => "Database user name should only contain alphanumeric characters");
         }
       } else if ($key == "hive_metastore_user_passwd") {
         if ($val == "") {