From: minima Date: Thu, 4 Oct 2001 11:45:57 +0000 (+0000) Subject: make callsign checking more rigorous X-Git-Tag: R_1_49~70 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=980b697bd47c8f575b1c9a7f01f9b01adc6746bd make callsign checking more rigorous --- diff --git a/Changes b/Changes index df398943..72f2d472 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ last port of call). 3. ignore deleted messages for queuing purposes 4. store deleted status across restarts! +5. make callsign checking more rigorous 03Oct01======================================================================= 1. don't allow @WWW to become a 'TO' field... 2. handle @gb7tlh.#35.eu type addresses as well diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 9d475ed8..018a404a 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -333,7 +333,7 @@ sub unpad # check that a field only has callsign characters in it sub is_callsign { - return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]+(?:-\d{1,2}|\/[A-Z0-9]+)?$/; + return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]{1,3}(?:-\d{1,2}|\/(?:[A-Z]{1,2}\d{0,2}|\d[A-Z]\d{0,2}))?$/; } # check that a PC protocol field is valid text diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index ae0e218b..75b025f3 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -95,7 +95,7 @@ sub dequeue &{$conn->{rproc}}($conn, "I$conn->{call}|$msg"); } elsif ($conn->{state} eq 'WL' ) { $msg = uc $msg; - if (is_callsign($msg)) { + if (is_callsign($msg) && $msg !~ m|/| ) { my $sort = $conn->{csort}; $sort = 'local' if $conn->{peerhost} eq "127.0.0.1"; $conn->to_connected($msg, 'A', $sort);