in who we accept which PC16/17/21's from.
01Oct01=======================================================================
1. made login info not the default
01Oct01=======================================================================
1. made login info not the default
+2. change the looping protoection for PC16/17/19/21 and also be more rigorous
+in who we accept which PC16/17/21's from.
30Sep01=======================================================================
1. made some small bug fixes in rspf checking and also messages.
23Sep01=======================================================================
30Sep01=======================================================================
1. made some small bug fixes in rspf checking and also messages.
23Sep01=======================================================================
$mode = 'r' if !$mode;
$self->{mode} = $mode;
$mode = 'r' if !$mode;
$self->{mode} = $mode;
+ $self->{jdate} = $jdate;
my $fh = new IO::File $self->{fn}, $mode, 0666;
return undef if !$fh;
$fh->autoflush(1) if $mode ne 'r'; # make it autoflushing if writable
$self->{fh} = $fh;
my $fh = new IO::File $self->{fn}, $mode, 0666;
return undef if !$fh;
$fh->autoflush(1) if $mode ne 'r'; # make it autoflushing if writable
$self->{fh} = $fh;
- $self->{jdate} = $jdate;
-
# DXDebug::dbg("opening $self->{fn}\n") if isdbg("dxlog");
return $self->{fh};
# DXDebug::dbg("opening $self->{fn}\n") if isdbg("dxlog");
return $self->{fh};
if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) {
$ref->stop_msg($self->call);
my $msgno = $m->{msgno};
if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) {
$ref->stop_msg($self->call);
my $msgno = $m->{msgno};
- dbg("duplicate message from $ref->{from} -> $ref->{to} to $msgno") if isdbg('msg');
- Log('msg', "duplicate message from $ref->{from} -> $ref->{to} to $msgno");
+ dbg("duplicate message from $ref->{from} -> $ref->{to} to msg: $msgno") if isdbg('msg');
+ Log('msg', "duplicate message from $ref->{from} -> $ref->{to} to msg: $msgno");
if ($pcno == 16) { # add a user
if ($pcno == 16) { # add a user
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC16 detected") if isdbg('chanerr');
+ return;
+ }
+
# general checks
my $dxchan;
my $ncall = $field[1];
# general checks
my $dxchan;
my $ncall = $field[1];
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
- $dxchan = DXChannel->get($ncall);
- if ($dxchan && $dxchan ne $self) {
- dbg("PCPROT: PC16 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
- return;
- }
my $parent = Route::Node::get($ncall);
unless ($parent) {
dbg("PCPROT: Node $ncall not in config") if isdbg('chanerr');
return;
}
my $parent = Route::Node::get($ncall);
unless ($parent) {
dbg("PCPROT: Node $ncall not in config") if isdbg('chanerr');
return;
}
+ $dxchan = $parent->dxchan;
+ if ($dxchan && $dxchan ne $self) {
+ dbg("PCPROT: PC16 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
+ return;
+ }
+
# input filter if required
return unless $self->in_filter_route($parent);
# input filter if required
return unless $self->in_filter_route($parent);
$user->lastin($main::systime) unless DXChannel->get($call);
$user->put;
}
$user->lastin($main::systime) unless DXChannel->get($call);
$user->put;
}
-
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC16 detected") if isdbg('chanerr');
- return;
- }
# queue up any messages (look for privates only)
DXMsg::queue_msg(1) if $self->state eq 'normal';
# queue up any messages (look for privates only)
DXMsg::queue_msg(1) if $self->state eq 'normal';
my $ncall = $field[2];
my $ucall = $field[1];
my $ncall = $field[2];
my $ucall = $field[1];
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC17 detected") if isdbg('chanerr');
+ return;
+ }
+
eph_del_regex("^PC16.*$ncall.*$ucall");
if ($ncall eq $main::mycall) {
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
eph_del_regex("^PC16.*$ncall.*$ucall");
if ($ncall eq $main::mycall) {
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
- $dxchan = DXChannel->get($ncall);
- if ($dxchan && $dxchan ne $self) {
- dbg("PCPROT: PC17 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
- return;
- }
my $uref = Route::User::get($ucall);
unless ($uref) {
my $uref = Route::User::get($ucall);
unless ($uref) {
+ $dxchan = $parent->dxchan;
+ if ($dxchan && $dxchan ne $self) {
+ dbg("PCPROT: PC17 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
+ return;
+ }
+
# input filter if required
return unless $self->in_filter_route($parent);
my @rout = $parent->del_user($uref);
# input filter if required
return unless $self->in_filter_route($parent);
my @rout = $parent->del_user($uref);
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC17 detected") if isdbg('chanerr');
- return;
- }
-
$self->route_pc17($parent, @rout) if @rout;
return;
}
$self->route_pc17($parent, @rout) if @rout;
return;
}
my $i;
my $newline = "PC19^";
my $i;
my $newline = "PC19^";
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC19 detected") if isdbg('chanerr');
+ return;
+ }
+
# new routing list
my @rout;
my $parent = Route::Node::get($self->{call});
# new routing list
my @rout;
my $parent = Route::Node::get($self->{call});
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC19 detected") if isdbg('chanerr');
- return;
- }
$self->route_pc19(@rout) if @rout;
return;
$self->route_pc19(@rout) if @rout;
return;
if ($pcno == 21) { # delete a cluster from the list
my $call = uc $field[1];
if ($pcno == 21) { # delete a cluster from the list
my $call = uc $field[1];
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC21 detected") if isdbg('chanerr');
+ return;
+ }
+
eph_del_regex("^PC1[79].*$call");
my @rout;
eph_del_regex("^PC1[79].*$call");
my @rout;
}
my $node = Route::Node::get($call);
if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
}
my $node = Route::Node::get($call);
if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
+ my $dxchan = $node->dxchan;
+ if ($dxchan && $dxchan ne $self) {
+ dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chanerr');
+ return;
+ }
+
if ($call eq $self->{call}) {
dbg("PCPROT: Trying to disconnect myself with PC21") if isdbg('chanerr');
return;
if ($call eq $self->{call}) {
dbg("PCPROT: Trying to disconnect myself with PC21") if isdbg('chanerr');
return;
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC21 detected") if isdbg('chanerr');
- return;
- }
-
$self->route_pc21(@rout) if @rout;
return;
}
$self->route_pc21(@rout) if @rout;
return;
}