poweradmin: いい加減なTDLのゾーンを作れるようにする。$dns_strict_tld_check = 0
hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ find . -name "*.php" -exec grep -H "You are using an invalid top level domain" {} \;
./inc/error.inc.php:define("ERR_DNS_INV_TLD", _('You are using an invalid top level domain.')); hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ find . -name "*.php" -exec grep -H "ERR_DNS_INV_TLD" {} \;./inc/error.inc.php:define("ERR_DNS_INV_TLD", _('You are using an invalid top level domain.'));
./inc/dns.inc.php: error(ERR_DNS_INV_TLD); return false; hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ vi inc/dns.inc.php function is_valid_hostname_fqdn($hostname, $wildcard) { global $dns_strict_tld_check;
global $valid_tlds; $hostname = ereg_replace("\.$","",$hostname); if (strlen($hostname) > 255) {
error(ERR_DNS_HN_TOO_LONG);
return false;
} $hostname_labels = explode ('.', $hostname);
$label_count = count($hostname_labels); foreach ($hostname_labels as $hostname_label) {
if ($wildcard == 1 && !isset($first)) { if (!preg_match('/^(\*|[\w-\/]+)$/',$hostname_label)) { error(ERR_DNS_HN_INV_CHARS); return false; }
$first = 1;
} else {
if (!preg_match('/^[\w-\/]+$/',$hostname_label)) { error(ERR_DNS_HN_INV_CHARS); return false; }
}
if (substr($hostname_label, 0, 1) == "-") { error(ERR_DNS_HN_DASH); return false; }
if (substr($hostname_label, -1, 1) == "-") { error(ERR_DNS_HN_DASH); return false; }
if (strlen($hostname_label) < 1 || strlen($hostname_label) > 63) { error(ERR_DNS_HN_LENGTH); return false; }
} if ($hostname_labels[$label_count-1] == "arpa" && (substr_count($hostname_labels[0], "/") == 1 XOR substr_count($hostname_lab
els[1], "/") == 1)) {
if (substr_count($hostname_labels[0], "/") == 1) {
$array = explode ("/", $hostname_labels[0]);
} else {
$array = explode ("/", $hostname_labels[1]);
}
if (count($array) != 2) { error(ERR_DNS_HOSTNAME) ; return false; }
if (!is_numeric($array[0]) || $array[0] < 0 || $array[0] > 255) { error(ERR_DNS_HOSTNAME) ; return false; }
if (!is_numeric($array[1]) || $array[1] < 25 || $array[1] > 31) { error(ERR_DNS_HOSTNAME) ; return false; }
} else {
if (substr_count($hostname, "/") > 0) { error(ERR_DNS_HN_SLASH) ; return false; }
}
if ($dns_strict_tld_check == "1" && !in_array($hostname_labels[$label_count-1], $valid_tlds)) {
error(ERR_DNS_INV_TLD); return false;
} return true;
} hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ sudo vim inc/config.inc.php $dns_strict_tld_check = 0 ;


Comments [0]