checking domain list syntax

This commit is contained in:
Abhinandan Prateek 2011-08-03 14:45:23 +05:30
parent f6303c13fb
commit bf0e761be1
1 changed files with 8 additions and 1 deletions

View File

@ -1187,9 +1187,16 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
// add the domain prefix list to details if not null
if (dnsSearchOrder != null){
for(String dom : dnsSearchOrder){
if (!NetUtils.verifyDomainName(dom)) {
throw new InvalidParameterValueException(
"Invalid network domain suffixes. Total length shouldn't exceed 190 chars. Each domain label must be between 1 and 63 characters long, can contain ASCII letters 'a' through 'z', the digits '0' through '9', "
+ "and the hyphen ('-'); can't start or end with \"-\"");
}
}
newDetails.put(ZoneConfig.DnsSearchOrder.getName(), StringUtils.join(dnsSearchOrder, ","));
}
if (userId == null) {
userId = Long.valueOf(User.UID_SYSTEM);
}