]> dxcluster.org Git - spider.git/commitdiff
fixed Aliases so that shutdown works again.
authorminima <minima>
Tue, 9 Oct 2001 14:03:31 +0000 (14:03 +0000)
committerminima <minima>
Tue, 9 Oct 2001 14:03:31 +0000 (14:03 +0000)
removed the ability for bad people to search the bad word space.

Changes
cmd/Aliases
cmd/announce.pl
cmd/dx.pl
cmd/talk.pl
perl/DXChannel.pm
perl/DXCommandmode.pm
perl/DXMsg.pm
perl/DXUser.pm

diff --git a/Changes b/Changes
index 0543269266435974b8eacc1db11013e32137ef44..8f5fd3cb3df0360cbd3aa42c262a31ca2c13357b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,15 @@
+09Oct01=======================================================================
+1. change Aliases to allow shutdown as a command again. If you have changed
+/spider/cmd/Aliases and you update from CVS you may find it better to remove
+this file and then do another 'cvs update'. Otherwise you may get conflicts
+and the Aliase file will not load properly. The cvs update will recreate 
+the (now) missing file.
+2. Remove the 'please don't use XXXX on here' messages to prevent people
+from exploring the 'bad words space'. Three bad words will still disconnect
+without warning. 
+3. Sending dx spots/announces with bad words will succeed - but only back to
+the sender. These two mods are designed to annoy the perpitrators of the
+sort of filth as much as possible whilst not inconveniencing 'normal' users.
 04Oct01=======================================================================
 1. allow a residence time of (default) 2 days before actually deleting a msg.
 2. reduce the number R: lines on a bull from a bbs to 2 (the origin and the
index 30d0549b20838ee06a38f8a0741de891110fbb4c..9b4737a4a591d69089e09798cff010faf19f9ec5 100644 (file)
@@ -93,9 +93,6 @@ package CmdAlias;
          '^rcmd/(\S+)', 'rcmd $1', 'rcmd',
        ],
        's' => [
-       '^set$', 'apropos set', 'apropos',
-       '^sh\w*$', 'apropos show', 'apropos',
-       '^st\w*$', 'apropos show', 'apropos',
          '^s/p$', 'send', 'send',
          '^sb$', 'send noprivate', 'send',
          '^set/home$', 'set/homenode', 'set/homenode',
@@ -108,6 +105,7 @@ package CmdAlias;
          '^set/nota', 'unset/talk', 'unset/talk',
          '^set/noww', 'unset/wwv', 'unset/wwv',
          '^set/nowx', 'unset/wx', 'unset/wx',
+       '^set$', 'apropos set', 'apropos',
          '^sh$', 'show', 'show',
          '^sh\w*/u$', 'show/user', 'show/user',
          '^sh\w*/bu', 'show/files bulletins', 'show/files',
@@ -122,7 +120,10 @@ package CmdAlias;
       '^sh\w*/up', 'show/cluster', 'show/cluster',
          '^sh\w*/w\w*/(\d+)-(\d+)', 'show/wwv $1-$2', 'show/wwv',
          '^sh\w*/w\w*/(\d+)', 'show/wwv $1', 'show/wwv',
+       '^shu\w*$', 'shutdown', 'shutdown',
+       '^sh\w*$', 'apropos show', 'apropos',
          '^sp$', 'send', 'send',
+       '^st\w*$', 'apropos stat', 'apropos',
        
     ],
        't' => [
index d2755b2df46309014c1b657e717baa94376992f4..3b07d84ddec974639e6943c16b5ae0eb92c2640f 100644 (file)
@@ -50,7 +50,10 @@ $line =~ s/\^/:/og;
 my @bad;
 if (@bad = BadWords::check($line)) {
        $self->badcount(($self->badcount||0) + @bad);
-       return (1, $self->msg('e17', @bad));
+       Log('DXCommand', "$self->{call} swore: $line");
+       Log('ann', $to, $from, "[to $from only] $line");
+       $self->send("To $to de $from <$t>: $line");
+       return (1, ());
 }
 
 return (1, $self->msg('dup')) if AnnTalk::dup($from, $toflag, $line);
index 73ba0de0e4275dd74d11d4c63f06244146673786..970182e4e28062b73b563c174bc024f20d03a9a6 100644 (file)
--- a/cmd/dx.pl
+++ b/cmd/dx.pl
@@ -15,12 +15,14 @@ my $spotted;
 my $freq;
 my @out;
 my $valid = 0;
+my $localonly;
 return (1, $self->msg('e5')) if $self->remotecmd;
 
 my @bad;
 if (@bad = BadWords::check($line)) {   
        $self->badcount(($self->badcount||0) + @bad);
-       return (1, $self->msg('e17', @bad));
+       Log('DXCommand', "$self->{call} swore: $line");
+       $localonly++;
 }
 
 # do we have at least two args?
@@ -102,7 +104,7 @@ return (1, @out) unless $valid;
 
 
 # Store it here (but only if it isn't baddx)
-if ($DXProt::baddx->in($spotted) || $freq =~ /^69/) {
+if ($DXProt::baddx->in($spotted) || $freq =~ /^69/ || $localonly) {
 
        # heaven forfend that we get a 69Mhz band :-)
        if ($freq =~ /^69/) {
index 9b7d359d3d6323aff40889ddbe13e4069b28c4a7..bb7164379bdc5ce0bb698f3a23e8a594ea4be64e 100644 (file)
@@ -41,9 +41,10 @@ if ($line) {
        my @bad;
        if (@bad = BadWords::check($line)) {
                $self->badcount(($self->badcount||0) + @bad);
-               return (1, $self->msg('e17', @bad));
+               Log('DXCommand', "$self->{call} swore: $line");
+       } else {
+               $dxchan->talk($self->call, $to, $via, $line) if $dxchan;
        }
-       $dxchan->talk($self->call, $to, $via, $line) if $dxchan;
 } else {
        my $s = $to;
        $s .= ">$via" if $via;
index 580783a6a466383f2ae8fac35106c03d2f38e38f..7f144d59046848c458dcb3759571b0b24e12ea64 100644 (file)
@@ -108,6 +108,7 @@ $count = 0;
                  metric => '1,Route metric',
                  badcount => '1,Bad Word Count',
                  edit => '7,Edit Function',
+                 registered => '9,Registered?,yesno',
                 );
 
 use vars qw($VERSION $BRANCH);
index ac0fb62470a942cf5c8d95830d7ff77b02507385..43dab0535fd0a1430442be5c6f75b3e03ebccacb 100644 (file)
@@ -222,8 +222,14 @@ sub normal
                        $self->send($self->talk_prompt);
                } elsif ($self->{talklist} && @{$self->{talklist}}) {
                        # send what has been said to whoever is in this person's talk list
-                       for (@{$self->{talklist}}) {
-                               $self->send_talks($_, $cmdline);
+                       my @bad;
+                       if (@bad = BadWords::check($cmdline)) {
+                               $self->badcount(($self->badcount||0) + @bad);
+                               Log('DXCommand', "$self->{call} swore: $cmdline");
+                       } else {
+                               for (@{$self->{talklist}}) {
+                                       $self->send_talks($_, $cmdline);
+                               }
                        }
                        $self->send($self->talk_prompt) if $self->{state} eq 'talk';
                } else {
index 7cab1d02f18336d930ab1c6da7c118f973c0eacd..4c9d2e59f52752b75817394055224e7482c28eec 100644 (file)
@@ -309,8 +309,8 @@ sub process
                                                }
                                                push @words, BadWords::check($ref->{subject});
                                                if (@words) {
-                                                       dbg("message with badwords '@words' $ref->{from} -> $ref->{to} '$ref->{subject}' origin: $ref->{origin} via " . $self->call) if isdbg('msg');
-                                                       Log('msg',"message with badwords '@words' $ref->{from} -> $ref->{to} origin: $ref->{origin} via " . $self->call);
+                                                       dbg("$ref->{from} swore: '@words' -> $ref->{to} '$ref->{subject}' origin: $ref->{origin} via " . $self->call) if isdbg('msg');
+                                                       Log('msg',"$ref->{from} swore: '@words' -> $ref->{to} origin: $ref->{origin} via " . $self->call);
                                                        Log('msg',"subject: $ref->{subject}");
                                                        for (@{$ref->{lines}}) {
                                                                Log('msg', "line: $_");
@@ -482,15 +482,12 @@ sub del_msg
                $self->{delete}++;
                $self->{deletetime} = 0;
        } else {
-               my $call;
-               if ($dxchan) {
-                       $call = " by " . $dxchan->call;
-               } else {
-                       $call = '';
-               }
-
                # remove it from the active message list
                @msg = grep { $_ != $self } @msg;
+
+               my $call = '';
+               $call = ' by ' . $dxchan->call if $dxchan;
+               Log("Msgno $self->{msgno} expunged$call");
                
                # remove the file
                unlink filename($self->{msgno});
@@ -659,7 +656,7 @@ sub queue_msg
                next if $ref->{tonode};           # ignore it if it already being processed
                
                # is it awaiting deletion?
-               if ($ref->{delete} && $main::systime > $ref->{deletetime}) {
+               if ($ref->{delete} && $main::systime >= $ref->{deletetime}) {
                        $ref->del_msg;
                        next;
                }
@@ -962,7 +959,7 @@ sub do_send_stuff
                if (my @ans = BadWords::check($line)) {
                        $self->{badcount} += @ans;
                        Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} in msg");
-                       return ($self->msg('e17', @ans), $self->msg('m1'));
+                       $loc->{reject}++;
                }
                $loc->{subject} = $line;
                $loc->{lines} = [];
@@ -974,33 +971,36 @@ sub do_send_stuff
                my $loc = $self->{loc};
                if ($line eq "\032" || $line eq '%1A' || uc $line eq "/EX") {
                        my $to;
-                       
-                       foreach $to (@{$loc->{to}}) {
-                               my $ref;
-                               my $systime = $main::systime;
-                               my $mycall = $main::mycall;
-                               $ref = DXMsg->alloc(DXMsg::next_transno('Msgno'),
-                                                                       uc $to,
-                                                                       exists $loc->{from} ? $loc->{from} : $self->call, 
-                                                                       $systime,
-                                                                       $loc->{private}, 
-                                                                       $loc->{subject}, 
-                                                                       exists $loc->{origin} ? $loc->{origin} : $mycall,
-                                                                       '0',
-                                                                       $loc->{rrreq});
-                               $ref->swop_it($self->call);
-                               $ref->store($loc->{lines});
-                               $ref->add_dir();
-                               push @out, $self->msg('m11', $ref->{msgno}, $to);
-                               #push @out, "msgno $ref->{msgno} sent to $to";
-                               my $dxchan = DXChannel->get(uc $to);
-                               if ($dxchan) {
-                                       if ($dxchan->is_user()) {
-                                               $dxchan->send($dxchan->msg('m9'));
+                       unless ($loc->{reject}) {
+                               foreach $to (@{$loc->{to}}) {
+                                       my $ref;
+                                       my $systime = $main::systime;
+                                       my $mycall = $main::mycall;
+                                       $ref = DXMsg->alloc(DXMsg::next_transno('Msgno'),
+                                                                               uc $to,
+                                                                               exists $loc->{from} ? $loc->{from} : $self->call, 
+                                                                               $systime,
+                                                                               $loc->{private}, 
+                                                                               $loc->{subject}, 
+                                                                               exists $loc->{origin} ? $loc->{origin} : $mycall,
+                                                                               '0',
+                                                                               $loc->{rrreq});
+                                       $ref->swop_it($self->call);
+                                       $ref->store($loc->{lines});
+                                       $ref->add_dir();
+                                       push @out, $self->msg('m11', $ref->{msgno}, $to);
+                                       #push @out, "msgno $ref->{msgno} sent to $to";
+                                       my $dxchan = DXChannel->get(uc $to);
+                                       if ($dxchan) {
+                                               if ($dxchan->is_user()) {
+                                                       $dxchan->send($dxchan->msg('m9'));
+                                               }
                                        }
                                }
+                       } else {
+                               Log('msg', $self->call . " swore to @{$loc->{to}} subject: '$loc->{subject}' in msg, REJECTED");
                        }
-
+                       
                        delete $loc->{lines};
                        delete $loc->{to};
                        delete $self->{loc};
@@ -1018,9 +1018,9 @@ sub do_send_stuff
                } else {
                        if (my @ans = BadWords::check($line)) {
                                $self->{badcount} += @ans;
-                               Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} subject: '$loc->{subject}' in msg");
+                               Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} subject: '$loc->{subject}' in msg") unless $loc->{reject};
                                Log('msg', "line: $line");
-                               return ($self->msg('e17', @ans));
+                               $loc->{reject}++;
                        }
                        
                        # i.e. it ain't and end or abort, therefore store the line
index ddcbc954da3248e74be2fa276b9e3b3709a26eff..160877aef11b5658ba9c3ad1e0988d3b016357a0 100644 (file)
@@ -74,6 +74,7 @@ $lasttime = 0;
                  wantann_talk => '0,Talklike Anns,yesno',
                  lastoper => '9,Last for/oper,cldatetime',
                  nothere => '0,Not Here Text',
+                 registered => '9,Registered?,yesno',
                 );
 
 no strict;