Changeset 981 for branches/cname-collision
- Timestamp:
- 01/14/26 13:06:45 (13 days ago)
- File:
-
- 1 edited
-
branches/cname-collision/DNSDB.pm (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cname-collision/DNSDB.pm
r980 r981 655 655 if ($t[0] > 0) { 656 656 if ($tcompare eq '<>') { 657 $errstr ="One or more non-CNAME records already exist for ".($args{revrec} eq 'y' ? $arpaname : $hcheck).658 ". CNAME records cannot use the same name as other records." ;657 return ('FAIL', "One or more non-CNAME records already exist for ".($args{revrec} eq 'y' ? $arpaname : $hcheck). 658 ". CNAME records cannot use the same name as other records."); 659 659 } else { 660 $errstr ="There is already a CNAME present for ".($args{revrec} eq 'y' ? $arpaname : $hcheck).661 ". Only one CNAME may be present for a given name." ;660 return ('FAIL', "There is already a CNAME present for ".($args{revrec} eq 'y' ? $arpaname : $hcheck). 661 ". Only one CNAME may be present for a given name."); 662 662 } 663 return;664 663 } 665 664 } … … 673 672 # if $t[0] > 1; 674 673 # } 675 return 1;674 return ('OK', 'OK'); 676 675 677 676 } # _cname_collision() … … 752 751 } 753 752 754 return ('FAIL', $errstr) unless $self->_cname_collision(%args);755 756 753 return ('OK','OK'); 757 754 } # done A record … … 806 803 } 807 804 } 808 809 return ('FAIL', $errstr) unless $self->_cname_collision(%args);810 805 811 806 return ('OK','OK'); … … 888 883 } # $zname !~ .rpz 889 884 } # revzone eq 'n' 890 891 return ('FAIL', $errstr) unless $self->_cname_collision(%args);892 885 893 886 return ('OK','OK'); … … 1017 1010 } 1018 1011 1019 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1020 1021 1012 return ('WARN',$warnflag) if $warnflag; 1022 1013 … … 1074 1065 1075 1066 } 1076 1077 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1078 1067 1079 1068 return ('OK','OK'); … … 1107 1096 } 1108 1097 1109 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1110 1111 1098 # Could arguably put a WARN return here on very long (>512) records 1112 1099 return ('OK','OK'); … … 1181 1168 ${$args{val}} = $args{addr}->addr; 1182 1169 } 1183 1184 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1185 1170 1186 1171 return ('OK','OK'); … … 1265 1250 1266 1251 } 1267 1268 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1269 1252 1270 1253 return ('OK','OK'); … … 1371 1354 # } else { 1372 1355 # } 1373 1374 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1375 1356 1376 1357 return ($code, $msg); … … 1656 1637 } 1657 1638 1658 # poor practice creating template records could result in a live CNAME collision1659 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1660 1661 1639 return ('OK','OK'); 1662 1640 } # done A+PTR template record … … 1707 1685 } 1708 1686 1709 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1710 1711 1687 return ('OK','OK'); 1712 1688 } # done delegation record … … 1760 1736 push @{$args{vallist}}, $liveips; 1761 1737 } 1762 1763 return ('FAIL', $errstr) unless $self->_cname_collision(%args);1764 1738 1765 1739 return ('WARN', join("\n", $errstr, $warnmsg) ) if $warnmsg; … … 4917 4891 return ($retcode,$retmsg) if $retcode eq 'FAIL'; 4918 4892 4893 # Check for CNAME collisions. 4894 ##fixme: should trim the list of arguments, not all of these should be required for CNAME collision checking 4895 my ($ccode,$cmsg) = _cname_collision($self, defrec => $defrec, revrec => $revrec, id => $id, 4896 host => $host, rectype => $rectype, val => $val, addr => $addr, 4897 dist => \$dist, port => \$port, weight => \$weight, 4898 stamp => \$stamp, expires => \$expires, 4899 fields => \$fields, vallist => \@vallist); 4900 4901 return ($ccode,$cmsg) if $ccode eq 'FAIL'; 4902 4903 # If both the validator and CNAME collision check return warnings, glue them together 4904 if ($ccode eq 'WARN') { 4905 if ($retcode eq 'WARN') { 4906 $retmsg .= "<br>\n$cmsg"; 4907 } else { 4908 $retmsg = $cmsg; 4909 } 4910 $retcode = 'WARN'; 4911 } 4912 4919 4913 # Set up database fields and bind parameters 4920 4914 $fields .= "host,type,val,ttl,"._recparent($defrec,$revrec); … … 5086 5080 5087 5081 return ($retcode,$retmsg) if $retcode eq 'FAIL'; 5082 5083 # Check for CNAME collisions. 5084 ##fixme: should trim the list of arguments, not all of these should be required for CNAME collision checking 5085 my ($ccode,$cmsg) = _cname_collision($self, defrec => $defrec, revrec => $revrec, 5086 id => ($defrec eq 'y' ? $oldrec->{group_id} : ($revrec eq 'n' ? $oldrec->{domain_id} : $oldrec->{rdns_id})), 5087 host => $host, rectype => $rectype, val => $val, addr => $addr, 5088 dist => \$dist, port => \$port, weight => \$weight, 5089 stamp => \$stamp, expires => \$expires, 5090 fields => \$fields, vallist => \@vallist, 5091 update => $id); 5092 5093 return ($ccode,$cmsg) if $ccode eq 'FAIL'; 5094 5095 # If both the validator and CNAME collision check return warnings, glue them together 5096 if ($ccode eq 'WARN') { 5097 if ($retcode eq 'WARN') { 5098 $retmsg .= "<br>\n$cmsg"; 5099 } else { 5100 $retmsg = $cmsg; 5101 } 5102 $retcode = 'WARN'; 5103 } 5088 5104 5089 5105 # Set up database fields and bind parameters. Note only the optional fields
Note:
See TracChangeset
for help on using the changeset viewer.
![[ DNS Administrator ]](/fx/dnsadmin-logo.png)