From: minima Date: Tue, 9 Oct 2001 14:03:31 +0000 (+0000) Subject: fixed Aliases so that shutdown works again. X-Git-Tag: R_1_49~53 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbcb636f1bc71eb1426685ef64382ea42d27ecfb;p=spider.git fixed Aliases so that shutdown works again. removed the ability for bad people to search the bad word space. --- diff --git a/Changes b/Changes index 05432692..8f5fd3cb 100644 --- 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 diff --git a/cmd/Aliases b/cmd/Aliases index 30d0549b..9b4737a4 100644 --- a/cmd/Aliases +++ b/cmd/Aliases @@ -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' => [ diff --git a/cmd/announce.pl b/cmd/announce.pl index d2755b2d..3b07d84d 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -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); diff --git a/cmd/dx.pl b/cmd/dx.pl index 73ba0de0..970182e4 100644 --- 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/) { diff --git a/cmd/talk.pl b/cmd/talk.pl index 9b7d359d..bb716437 100644 --- a/cmd/talk.pl +++ b/cmd/talk.pl @@ -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; diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 580783a6..7f144d59 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -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); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index ac0fb624..43dab053 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -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 { diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 7cab1d02..4c9d2e59 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -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 diff --git a/perl/DXUser.pm b/perl/DXUser.pm index ddcbc954..160877ae 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -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;