You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ra...@apache.org on 2012/05/17 19:10:52 UTC
svn commit: r1339717 - in /incubator/ambari/branches/ambari-186: CHANGES.txt
hmc/php/frontend/createCluster.php
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