spider/cmd/pc.pl
djk 80a2dd317e 1. Added a bit more checking to the rcmd thing to make more sure that this
rcmd isn't coming from an imposter. Not possible to prevent everything
ofcourse, just make it a bit harder.
2. altered set/lockout and set/privilege so that they can't executed remotely.
3. Added some code to reject rubbish (with invalid binary characters) protocol
or user lines as input.
4. prevented PC command being executed remotely :-)
1999-05-08 21:09:11 +00:00

23 lines
494 B
Perl

#
# send a manual PC protocol (or other) message to the callsign
#
# Copyright (c) 1998 Dirk Koopman G1TLH
#
# $Id$
#
my $self = shift;
my $line = shift;
my @f = split /\s+/, $line;
return (1, $self->msg('e5')) if $self->priv < 8 || $self->remotecmd;
my $call = uc shift @f;
my $dxchan = DXChannel->get($call);
return (1, $self->msg('e10', $call)) if !$dxchan;
return (1, $self->msg('e8')) if @f <= 0;
$line =~ s/$call\s+//i; # remove callsign and space
$dxchan->send($line);
return (1);