2. merge in latest (2Mar2005) cty.dat
3. fix command searching so it does not pick up false positives for commands
with / in them in directories that don't have that.
+4. Important security change.
+5. add missing input filter for WWV
16Mar05=======================================================================
1. make the correct correction to the DL entry in wpxloc.raw (left out the
'N' of 'North' in the latitude).
if ($cmd) {
# strip out // on command only
$cmd =~ s|//|/|g;
+ $cmd =~ s|^/||g; # no leading / either
+ $cmd =~ s|[^-\w/]||g; # and no funny characters either
my ($path, $fcmd);
# first expand out the entry to a command
($path, $fcmd) = search($main::localcmd, $cmd, "pl");
- ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
+ ($path, $fcmd) = search($main::cmd, $cmd, "pl") unless $path && $fcmd;
if ($path && $cmd) {
dbg("path: $cmd cmd: $fcmd") if isdbg('command');
return unless $self->{wwv};
if ($self->{wwvfilter}) {
- ($filter, $hops) = $self->{wwvfilter}->it(@_ );
+ ($filter, $hops) = $self->{wwvfilter}->it(@_[7..$#_] );
return unless $filter;
}
dbg("PCPROT: WWV Date ($_[1] $_[2]) out of range") if isdbg('chanerr');
return;
}
+
+ # global wwv filtering on INPUT
+ my @dxcc = ((Prefix::cty_data($_[6]))[0..2], (Prefix::cty_data($_[7]))[0..2]);
+ if ($self->{inwwvfilter}) {
+ my ($filter, $hops) = $self->{inwwvfilter}->it(@_[7,8], $origin, @dxcc);
+ unless ($filter) {
+ dbg("PCPROT: Rejected by input spot filter") if isdbg('chanerr');
+ return;
+ }
+ }
if (Geomag::dup($d,$sfi,$k,$i,$_[6])) {
dbg("PCPROT: Dup WWV Spot ignored\n") if isdbg('chanerr');
return;
my ($filter, $hops);
if ($self->{wwvfilter}) {
- ($filter, $hops) = $self->{wwvfilter}->it(@_);
+ ($filter, $hops) = $self->{wwvfilter}->it(@_[7..$#_]);
return unless $filter;
}
send_prot_line($self, $filter, $hops, $isolate, $line)
$filterdef = bless ([
# tag, sort, field, priv, special parser
- ['by', 'c', 7],
- ['origin', 'c', 8],
- ['channel', 'c', 9],
- ['by_dxcc', 'nc', 10],
- ['by_itu', 'ni', 11],
- ['by_zone', 'nz', 12],
- ['origin_dxcc', 'nc', 13],
- ['origin_itu', 'ni', 14],
- ['origin_zone', 'nz', 15],
+ ['by', 'c', 0],
+ ['origin', 'c', 1],
+ ['channel', 'c', 2],
+ ['by_dxcc', 'nc', 3],
+ ['by_itu', 'ni', 4],
+ ['by_zone', 'nz', 5],
+ ['origin_dxcc', 'nc', 6],
+ ['origin_itu', 'ni', 7],
+ ['origin_zone', 'nz', 8],
], 'Filter::Cmd');
sub init