domain syntax check for zoneupdate

This commit is contained in:
Abhinandan Prateek 2011-08-03 14:41:04 +05:30
parent 6dd519ddd4
commit b74c398d76
1 changed files with 7 additions and 0 deletions

View File

@ -1187,6 +1187,13 @@ 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, ","));
}