cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [37/51] [abbrv] git commit: updated refs/heads/useraccount-refactoring to 1e25886
Date Fri, 28 Nov 2014 18:03:51 GMT
CLOUDSTACK-7976 : Param validation for global params involving domain name


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/95ea2039
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/95ea2039
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/95ea2039

Branch: refs/heads/useraccount-refactoring
Commit: 95ea20390739a24dad92895b8db712282be31bbb
Parents: 86895ec
Author: amoghvk <amogh.vasekar@citrix.com>
Authored: Wed Nov 26 14:54:42 2014 -0800
Committer: amoghvk <amogh.vasekar@citrix.com>
Committed: Wed Nov 26 14:54:42 2014 -0800

----------------------------------------------------------------------
 .../src/com/cloud/configuration/ConfigurationManagerImpl.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/95ea2039/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 9d25b30..714e6fc 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -327,7 +327,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
 
     private int _maxVolumeSizeInGb = Integer.parseInt(Config.MaxVolumeSize.getDefaultValue());
     private long _defaultPageSize = Long.parseLong(Config.DefaultPageSize.getDefaultValue());
-    private static final String DOMAIN_NAME_PATTERN = "^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$";
+    private static final String DOMAIN_NAME_PATTERN = "^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$";
     protected Set<String> configValuesForValidation;
     private Set<String> weightBasedParametersForValidation;
     private Set<String> overprovisioningFactorsForValidation;
@@ -844,7 +844,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                 if (value.startsWith("*")) {
                     domainName = value.substring(2); //skip the "*."
                 }
-                if (!domainName.matches(DOMAIN_NAME_PATTERN)) {
+                //max length for FQDN is 253 + 2, code adds xxx-xxx-xxx-xxx to domain name
when creating URL
+                if (domainName.length() >= 238 || !domainName.matches(DOMAIN_NAME_PATTERN))
{
                     return "Please enter a valid string for domain name, prefixed with '*.'
if applicable";
                 }
             } else if (range.equals("routes")) {


Mime
View raw message