From 4b1dd2cb842a8e7df9b1b3e9a8e166e333dfec0a Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 30 Jul 2000 13:24:53 +0000 Subject: [PATCH] and again... --- perl/DXCommandmode.pm | 8 ++++++-- perl/DXProt.pm | 10 +++++++--- perl/Messages | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index ab82d904..70ba4b92 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -196,8 +196,11 @@ sub normal for (@{$self->{talklist}}) { my $ent = $_; my ($to, $via) = $ent =~ /(\S+)>(\S+)/; - my $dxchan = DXChannel->get($via); - if ($dxchan && DXCluster->get_exact($to)) { + $to = $ent unless $to; + my $call = $via ? $via : $to; + my $clref = DXCluster->get_exact($call); + my $dxchan = $clref->dxchan if $clref; + if ($dxchan) { $dxchan->talk($self->{call}, $to, $via, $cmdline); } else { $self->send($self->msg('disc2', $via ? $via : $to)); @@ -229,6 +232,7 @@ sub talk_prompt my @call; for (@{$self->{talklist}}) { my ($to, $via) = /(\S+)>(\S+)/; + $to = $_ unless $to; push @call, $to; } return $self->msg('talkprompt', join(',', @call)); diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 65ad93f9..90506ed4 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -221,11 +221,15 @@ sub normal return; } - # are any of the crucial fields invalid? - if ($field[2] =~ /(?:^\s*$|[a-z])/ || $field[6] =~ /(?:^\s*$|[a-z])/ || $field[7] =~ /(?:^\s*$|[a-z])/) { + # are any of the callsign fields invalid? + if ($field[2] =~ m/[^A-Z0-9\-\/]/ || $field[6] =~ m/[^A-Z0-9\-]/ || $field[7] =~ m/[^A-Z0-9\-]/) { dbg('chan', "Spot contains lower case callsigns or blanks, rejected"); return; } + if ($field[1] =~ m/[^0-9\.]/) { + dbg('chan', "Spot frequency not numeric, rejected"); + return; + } # do some de-duping $field[5] =~ s/^\s+//; # take any leading blanks off @@ -619,7 +623,7 @@ sub normal my $ref = DXUser->get_current($field[2]); my $cref = DXCluster->get($field[2]); Log('rcmd', 'in', $ref->{priv}, $field[2], $field[3]); - unless ($field[3] =~ /rcmd/i || !$cref || !$ref || $cref->mynode->call ne $ref->homenode) { # not allowed to relay RCMDS! + unless (!$cref || !$ref || $cref->mynode->call ne $ref->homenode) { # not allowed to relay RCMDS! if ($ref->{priv}) { # you have to have SOME privilege, the commands have further filtering $self->{remotecmd} = 1; # for the benefit of any command that needs to know my $oldpriv = $self->{priv}; diff --git a/perl/Messages b/perl/Messages index 7918a6e1..0f753716 100644 --- a/perl/Messages +++ b/perl/Messages @@ -115,6 +115,7 @@ package DXM; m14 => 'Message no $_[0] marked as sent to $_[1]', m15 => 'Message no $_[0] unmarked as sent to $_[1]', m16 => 'Need a Message number', + m17 => 'Sorry, cannot send messages in $_[0] mode', msg1 => 'Bulletin Messages Queued', msg2 => 'Private Messages Queued', msg3 => 'Msg $_[0]: $_[1] changed from $_[2] to $_[3]', -- 2.43.0