Changeset 716 for trunk


Ignore:
Timestamp:
04/15/16 12:16:13 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Add a flag argument to getRecList() for RPC callers to override showrev_arpa
Fix minor SQL ambiguity in getRecList() filter arguments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r715 r716  
    41894189  $args{defrec} = 'n' if !$args{defrec};
    41904190
     4191  # RPC callers generally want the "true" IP.  Flag argument for those to bypass showrev_arpa
     4192##fixme:  this will still blow up if some idiot has actually stored .arpa names in the DB.
     4193# ... do we care?
     4194  $args{rpc} = 0 if !$args{rpc};
     4195
    41914196  # protection against bad or missing arguments
    41924197  $args{sortorder} = 'ASC' if !$args{sortorder} || !grep /^$args{sortorder}$/, ('ASC','DESC');
     
    42314236  foreach (qw(type distance weight port ttl description location)) {
    42324237    if ($args{$_}) {
    4233       $sql .= " AND $_ ~* ?";
     4238      $sql .= " AND r.$_ ~* ?";
    42344239      push @bindvars, $args{$_};
    42354240    }
     
    42604265  $recsth->execute(@bindvars);
    42614266  while (my $rec = $recsth->fetchrow_hashref) {
    4262     if ($args{revrec} eq 'y' && $args{defrec} eq 'n' &&
     4267    if (!$args{rpc} && $args{revrec} eq 'y' && $args{defrec} eq 'n' &&
    42634268        ($self->{showrev_arpa} eq 'record' || $self->{showrev_arpa} eq 'all') &&
    42644269        $rec->{val} !~ /\.arpa$/ ) {
Note: See TracChangeset for help on using the changeset viewer.