ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r1339717 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/frontend/createCluster.php
Date Thu, 17 May 2012 17:10:52 GMT
Author: ramya
Date: Thu May 17 17:10:51 2012
New Revision: 1339717

URL: http://svn.apache.org/viewvc?rev=1339717&view=rev
Log:
AMBARI-250. Cluster name validation

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

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1339717&r1=1339716&r2=1339717&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Thu May 17 17:10:51 2012
@@ -1,6 +1,8 @@
 Ambari Change log
 
 Release 0.x.x - unreleased
+ 
+  AMBARI-250. Cluster name validation (Vikram Dixit via ramya)
 
   AMBARI-243. Templeton setup fails due to hive download error. (ramya)
 

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php?rev=1339717&r1=1339716&r2=1339717&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php Thu May 17 17:10:51
2012
@@ -37,6 +37,12 @@ if (preg_match("/[\s]+/", $clusterName) 
   print json_encode(array("result" => 1, "error" => "Cluster name cannot contain whitespaces"));
   return;
 }
+
+// do not allow ? ! * + - | " [ ] / ( ) { } ! @ # $ % ^ & * ( ) ' ` ~ , .
+if (preg_match('/(\?|\+|\-|\||\"|\[|\]|\/|\{|\}|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\'|\`|\~|\,|\.)/',
$clusterName) > 0) {
+  print json_encode(array("result" => 1, "error" => "Cluster name cannot contain special
characters"));
+  return;
+}
 // Validate clusterName: TODO; FIXME
 
 // create the lockfile in the clusterDir



Mime
View raw message