Changeset 1037 for branches


Ignore:
Timestamp:
02/12/26 18:03:01 (28 hours ago)
Author:
Kris Deugau
Message:

/branches/stable

Roll up most remaining patches applied in production

Location:
branches/stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable

  • branches/stable/DNSDB.pm

    r1034 r1037  
    698698        unless ${$args{val}} =~ /^(?:\.|\*\.|rpz-passthru\.|rpz-drop\.|rpz-tcp-only\.)$/;
    699699      # Append the RPZ name
    700       my $pname = ($args{defrec} eq 'y' ? 'DOMAIN' : $self->domainName($args{id}));
     700      my $pname = ($args{defrec} eq 'y' ? 'DOMAIN' : $zname);
    701701      ${$args{host}} =~ s/\.*$/\.$pname/ if ${$args{host}} !~ /$pname$/i;
    702702    } else {
     
    28052805  }
    28062806
    2807   my ($domid) = $dbh->selectrow_array(
    2808         "SELECT domain_id FROM domains WHERE lower(domain) = lower(?) AND default_location = ?",
    2809         undef, ($domain, $location) );
     2807  my $sql = "SELECT domain_id FROM domains WHERE lower(domain) = lower(?)";
     2808  my @zargs = ($domain);
     2809  # yay magic strings!
     2810  if ($location eq ':ANY:') {
     2811    # no-op
     2812  } else {
     2813    $sql .= " AND default_location = ?";
     2814    push @zargs, $location;
     2815  }
     2816
     2817  my ($domid) = $dbh->selectrow_array($sql, undef, @zargs);
     2818
    28102819  if (!$domid) {
    28112820    if ($dbh->err) {
     
    28362845  }
    28372846
    2838   my ($revid) = $dbh->selectrow_array(
    2839         "SELECT rdns_id FROM revzones WHERE revnet = ? AND default_location = ?",
    2840         undef, ($revzone, $location) );
     2847  my $sql = "SELECT rdns_id FROM revzones WHERE revnet = ?";
     2848  my @zargs = ($revzone);
     2849  # yay magic strings!
     2850  if ($location eq ':ANY:') {
     2851    # no-op
     2852  } else {
     2853    $sql .= " AND default_location = ?";
     2854    push @zargs, $location;
     2855  }
     2856
     2857  my ($revid) = $dbh->selectrow_array($sql, undef, @zargs);
     2858
    28412859  if (!$revid) {
    28422860    if ($dbh->err) {
     
    66886706      $$recflags{$ip}++;
    66896707      next if $hpat eq '%blank%';       # Allows blanking a subnet so no records are published.
     6708      next if $hpat =~ /^\%blank\%/;    # Safety net in case of oopses elsewhere
    66906709      my $rec = $hpat;  # start fresh with the template for each IP
    66916710##fixme:  there really isn't a good way to handle sub-/24 zones here.  This way at least
  • branches/stable/dns-rpc.cgi

    r1034 r1037  
    907907  my $ret = $dnsdb->getRecList(defrec => $args{defrec}, revrec => $args{revrec}, id => $args{id},
    908908        offset => $args{offset}, nrecs => $args{nrecs}, sortby => $args{sortby},
    909         sortorder => $args{sortorder}, filter => $args{filter});
     909        sortorder => $args{sortorder}, filter => $args{filter}, location => $args{location});
    910910  die $dnsdb->errstr."\n" if !$ret;
    911911
    912912  return $ret;
    913 }
     913} # getRecList()
    914914
    915915
Note: See TracChangeset for help on using the changeset viewer.