2. Fix who command to make RBN connections as RBN and not USER.
3. Prevent other nodes claiming that $myalias or $mycall is a different type
(user or node) from changing our route table and thence the user type.
+4. Normalise callsigns of incoming connections to G1TST if G1TST-0 or G1TST-00
+ amd G1TST-2 if G1TST-02. There are 800+ instances of callsigns with extra
+ 0 characters in the SSID in my users file. Allow SSIDs up to 99.
02Jan22=======================================================================
1. Fix dx bug introduced to handle dx by ip <ipaddr> for webclusters.
2. Remove _add_thingy dbg message from general view.
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
is_prefix dd is_ipaddr $pi $d2r $r2d localdata localdata_mv
diffms _diffms _diffus difft parraydifft is_ztime basecall
+ normalise_call
);
my ($r) = $_[0] =~ m|^(?:[\w\d]+/)?([\w\d]+).*$|;
return $r;
}
+
+sub normalise_call
+{
+ my ($c, $ssid) = $_[0] =~ m|^((?:[\w\d]+/)?[\d\w]+(?:/[\w\d]+)?)-?(\d+)?$|;
+ my $ncall = $c;
+ $ssid += 0;
+ $ncall .= "-$ssid" if $ssid;
+ return $ncall;
+
+}
$conn->disconnect;
}
} elsif (is_callsign($msg)) {
+ my $call = normalise_call($msg);
if ($main::allowslashcall || $msg !~ m|/|) {
my $sort = $conn->{csort};
$sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1';
my $uref;
- if ($main::passwdreq || ($uref = DXUser::get_current($msg)) && $uref->passwd ) {
- $conn->conns($msg);
+ if ($main::passwdreq || ($uref = DXUser::get_current($call)) && $uref->passwd ) {
+ $conn->conns($call);
$conn->{state} = 'WP';
$conn->{decho} = $conn->{echo};
$conn->{echo} = 0;
already_conn($conn, $call, "Maximum no of web connected connects ($Web::maxssid) exceeded");
return;
}
- $call = $newcall;
+ $call = normalise_call($newcall);
+
$user = DXUser::get_current($call);
unless ($user) {
$user = DXUser->new($call);
$conn->send_now("C$call");
} else {
# "Normal" connections
+
+ # normalise calls like G1TST-0/G1TST-00/G1TST-01 to G1TST and G1TST-1 respectively
+ my $ncall = normalise_call($call);
+ if ($call ne $ncall) {
+ LogDbg('err', "new_channel login invalid $call converted to $ncall");
+ $msg =~ s/$call/$ncall/;
+ $call = $ncall;
+ }
+ # is it a valid callsign (in format)?
unless (is_callsign($call)) {
already_conn($conn, $call, DXM::msg($lang, "illcall", $call));
return;
# is he locked out ?
my $lock;
- $user = DXUser::get_current($call);
$conn->conns($call);
+ $user = DXUser::get_current($call);
my $basecall = $call;
$basecall =~ s/-\d+$//; # remember this for later multiple user processing, it's used for other stuff than checking lockout status
if ($user) {
$call = uc $myalias unless $call;
$node = uc $mycall unless $node;
+$call = normalise_call($call);
my ($scall, $ssid) = split /-/, $call;
$ssid = undef unless $ssid && $ssid =~ /^\d+$/;
if ($ssid) {
- $ssid = 15 if $ssid > 15;
+ $ssid = 99 if $ssid > 99;
$call = "$scall-$ssid";
}