Changeset 129 for trunk


Ignore:
Timestamp:
09/30/11 17:29:57 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Data validation - check attempts to add an A or AAAA record to
make sure that the address really is a valid IP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r128 r129  
    12811281  my $val = shift;
    12821282  my $ttl = shift;
     1283
     1284  # Validation
     1285  if ($rectype == $reverse_typemap{A} or $rectype == $reverse_typemap{AAAA}) {
     1286    my $tmpip = new NetAddr::IP $val or
     1287        return ("FAIL", "Address must be a valid IP address");
     1288  }
    12831289
    12841290  my $fields = ($defrec eq 'y' ? 'group_id' : 'domain_id').",host,type,val,ttl";
Note: See TracChangeset for help on using the changeset viewer.