Changeset 417 for trunk


Ignore:
Timestamp:
10/05/12 17:21:35 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix data integrity glitch; leading and trailing spaces were not
stripped from host and value. Only the value for TXT records will
be left alone - leading or trailing spaces could be legit there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r415 r417  
    34573457  $location  = '' if !$location;
    34583458
     3459  # Spaces are evil.
     3460  $$host =~ s/^\s+//;
     3461  $$host =~ s/\s+$//;
     3462  if ($typemap{$$type} ne 'TXT') {
     3463    # Leading or trailng spaces could be legit in TXT records.
     3464    $$val =~ s/^\s+//;
     3465    $$val =~ s/\s+$//;
     3466  }
     3467
    34593468  # prep for validation
    34603469  my $addr = NetAddr::IP->new($$val);
     
    35743583  my $location = shift; # may be empty/null/undef depending on caller
    35753584  $location  = '' if !$location;
     3585
     3586  # Spaces are evil.
     3587  $$host =~ s/^\s+//;
     3588  $$host =~ s/\s+$//;
     3589  if ($typemap{$$type} ne 'TXT') {
     3590    # Leading or trailng spaces could be legit in TXT records.
     3591    $$val =~ s/^\s+//;
     3592    $$val =~ s/\s+$//;
     3593  }
    35763594
    35773595  # prep for validation
     
    45824600        $ttl = '' if $ttl == '0';
    45834601
     4602        # Spaces are evil.
     4603        $$host =~ s/^\s+//;
     4604        $$host =~ s/\s+$//;
     4605        if ($typemap{$$type} ne 'TXT') {
     4606          # Leading or trailng spaces could be legit in TXT records.
     4607          $$val =~ s/^\s+//;
     4608          $$val =~ s/\s+$//;
     4609        }
     4610
    45844611        _printrec_tiny($datafile, 'n', \%recflags,
    45854612                $dom, $host, $type, $val, $dist, $weight, $port, $ttl, $loc, $stamp);
Note: See TracChangeset for help on using the changeset viewer.