Changeset 959
- Timestamp:
- 12/30/25 16:51:56 (4 hours ago)
- File:
-
- 1 edited
-
branches/cname-collision/DNSDB.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cname-collision/DNSDB.pm
r942 r959 637 637 if (${$args{rectype}} == 5) { 638 638 # First, check for non-CNAME collisions. 639 my @t = $dbh->selectrow_array("SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}). 640 " WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type <> 5 AND $hfield = ?", 641 undef, $args{id}, $hcheck); 639 my $sql = "SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}). 640 " WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type <> 5 AND $hfield = ?"; 641 my @lookupargs = ($args{id}, $hcheck); 642 if ($args{update}) { 643 $sql .= " AND record_id <> ?"; 644 push @lookupargs, $args{update}; 645 } 646 my @t = $dbh->selectrow_array($sql, undef, @lookupargs); 642 647 if ($t[0] > 0) { 643 648 $errstr = "One or more non-CNAME records already exist for ".($args{revrec} eq 'y' ? $arpaname : $hcheck). … … 648 653 649 654 # Second, check for multiple CNAMEs 650 my @t = $dbh->selectrow_array("SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}). 651 " WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type = 5 AND $hfield = ?", 652 undef, $args{id}, $hcheck); 655 my $sql = "SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}). 656 " WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type = 5 AND $hfield = ?"; 657 my @lookupargs = ($args{id}, $hcheck); 658 if ($args{update}) { 659 $sql .= " AND record_id <> ?"; 660 push @lookupargs, $args{update}; 661 } 662 my @t = $dbh->selectrow_array($sql, undef, @lookupargs); 653 663 if ($t[0] > 0) { 654 664 $errstr = "There is already a CNAME present for ".($args{revrec} eq 'y' ? $arpaname : $hcheck).
Note:
See TracChangeset
for help on using the changeset viewer.
![[ DNS Administrator ]](/fx/dnsadmin-logo.png)