fix and moan if mycall and myalias are lowercase
authorDirk Koopman <djk@tobit.co.uk>
Sat, 18 Mar 2023 00:06:48 +0000 (00:06 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 18 Mar 2023 00:06:48 +0000 (00:06 +0000)
Changes
perl/DXUser.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index 840bcdc0f4a432658888aef6b5dd3014a0ff508f..6d25e1a7bed45a412b63b8cca21e9a8c87cce7ac 100644 (file)
--- a/Changes
+++ b/Changes
@@ -4,6 +4,8 @@
 2. Do some housekeeping with the startup and finish debugging to make the 
    order of messaging more logical. Also disable some messaging caused by 
    other errors/circumstances causing various object handles disappearing.  
 2. Do some housekeeping with the startup and finish debugging to make the 
    order of messaging more logical. Also disable some messaging caused by 
    other errors/circumstances causing various object handles disappearing.  
+3. Make sure that $mycall and $myalias are upper case (and moan about it if
+   they aren't.
 10Mar23=======================================================================
 1. I am aware that there are windows nodes out there on mojo (brave, impetuous 
    that you are) and wget is not an easy option to download badip files. So, 
 10Mar23=======================================================================
 1. I am aware that there are windows nodes out there on mojo (brave, impetuous 
    that you are) and wget is not an easy option to download badip files. So, 
index 7481ed8456c423a84ada12dba8ad585315ae3f83..116b69e62eebec01552ec5bb2a9c47066d9d4f61 100644 (file)
@@ -354,7 +354,7 @@ sub close
        my $ip = shift;
        # add a record to the connect list
        $self->{lastin} = $main::systime;
        my $ip = shift;
        # add a record to the connect list
        $self->{lastin} = $main::systime;
-       my $ref = [$startt || $self->{startt}, $main::systime];
+       my $ref = [$self->{startt} || $startt, $main::systime];
        push @$ref, $ip if $ip;
        push @{$self->{connlist}}, $ref;
        shift @{$self->{connlist}} if @{$self->{connlist}} > $maxconnlist;
        push @$ref, $ip if $ip;
        push @{$self->{connlist}}, $ref;
        shift @{$self->{connlist}} if @{$self->{connlist}} > $maxconnlist;
index 7188ed6f426189e65460842c58170ddfdc353d3e..c2e32b5f6a1206aa510d11f9f3efb5aee47faaf3 100755 (executable)
@@ -625,6 +625,7 @@ sub setup_start
                $SIG{INT} = $SIG{TERM} = sub { $ending = 10; };
        }
 
                $SIG{INT} = $SIG{TERM} = sub { $ending = 10; };
        }
 
+
        # setup location of motd & issue
        localdata_mv($motd);
        $motd = localdata($motd);
        # setup location of motd & issue
        localdata_mv($motd);
        $motd = localdata($motd);
@@ -656,14 +657,14 @@ sub setup_start
        {
                die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';). Oh and don't forget to rerun create_sysop.pl!" if $mycall eq $myalias;
                my $ref = DXUser::get($mycall);
        {
                die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';). Oh and don't forget to rerun create_sysop.pl!" if $mycall eq $myalias;
                my $ref = DXUser::get($mycall);
-               die "$mycall missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9;
+               die "\$mycall missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9;
                my $oldsort = $ref->sort;
                if ($oldsort ne 'S') {
                        $ref->sort('S');
                        dbg("Resetting node type from $oldsort -> DXSpider ('S')");
                }
                $ref = DXUser::get($myalias);
                my $oldsort = $ref->sort;
                if ($oldsort ne 'S') {
                        $ref->sort('S');
                        dbg("Resetting node type from $oldsort -> DXSpider ('S')");
                }
                $ref = DXUser::get($myalias);
-               die "$myalias missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9;
+               die "\$myalias missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9;
                $oldsort = $ref->sort;
                if ($oldsort ne 'U') {
                        $ref->sort('U');
                $oldsort = $ref->sort;
                if ($oldsort ne 'U') {
                        $ref->sort('U');
@@ -671,6 +672,23 @@ sub setup_start
                }
        }
 
                }
        }
 
+       # make sure that mycall, myalias and homenode are upper case;
+       my $flag = 0;
+       if ($mycall =~ /[a-z]/) {
+               LogDbg('err', "\$mycall '$mycall' contains lower case letters, correcting");
+               $mycall = uc $mycall;
+               ++$flag;
+       }
+       if ($myalias =~ /[a-z]/) {
+               LogDbg('err', "\$myalias '$myalias' contains lower case letters, correcting");
+               $myalias = uc $myalias;
+               ++$flag;
+       }
+       if ($flag) {
+               LogDbg('err', "DXVars.pm has $flag errors. See above. Please edit DXVars.pm to correct");
+               sleep 10;
+       }
+       
        # read any route cache there might be
        Route::read_cache() if $save_route_cache;
        
        # read any route cache there might be
        Route::read_cache() if $save_route_cache;