+09Mar12=======================================================================
+1. Try to trap unblessed references on receipt of PC34s
15Feb12=======================================================================
1. Add CTY2202 changes
25Jan12=======================================================================
my ($self, $tonode, $fromnode, $user, $cmd) = @_;
if ($tonode eq $main::mycall) {
my $ref = DXUser::get_current($fromnode);
+ unless ($ref && UNIVERSAL($ref, 'DXUser')) {
+ dbg("DXProt process_rcmd: user $fromnode isn't a reference (check user_asc and tell G1TLH)");
+ $self->send_rcmd_reply($main::mycall, $fromnode, $user, "sorry...!");
+ return;
+ }
my $cref = Route::Node::get($fromnode);
+ unless ($cref && UNIVERSAL($cref, 'Route')) {
+ dbg("DXProt process_rcmd: Route $fromnode isn't a reference (tell G1TLH)");
+ $self->send_rcmd_reply($main::mycall, $fromnode, $user, "sorry...!");
+ return;
+ }
Log('rcmd', 'in', ($ref->{priv}||0), $fromnode, $cmd);
- if ($cmd !~ /^\s*rcmd/i && $cref && $ref && $ref->homenode && $cref->call eq $ref->homenode) { # not allowed to relay RCMDS!
+ if ($cmd !~ /^\s*rcmd/i && $ref->homenode && $cref->call eq $ref->homenode) { # not allowed to relay RCMDS!
if ($ref->{priv}) { # you have to have SOME privilege, the commands have further filtering
$self->{remotecmd} = 1; # for the benefit of any command that needs to know
my $oldpriv = $self->{priv};
unless ($dbm->get($call, $data)) {
$ref = decode($data);
if ($ref) {
- if (ref $ref ne 'DXUser') {
+ if (UNIVERSAL::isa($ref, 'DXUser')) {
dbg("DXUser::get: got strange answer from decode ". ref $ref. " ignoring");
return undef;
}
+ # we have a reference and it *is* a DXUser
} else {
dbg("DXUser::get: no reference returned from decode $!");
return undef;
my $dxchan = DXChannel::get($call);
if ($dxchan) {
my $ref = $dxchan->user;
- return $ref if ref $ref eq 'DXUser';
+ return $ref if $ref && UNIVERSAL::isa($ref, 'DXUser');
dbg("DXUser::get_current: got invalid user ref from dxchan $dxchan->{call} ". ref $ref. " ignoring");
}