]> dxcluster.org Git - spider.git/commitdiff
log all incoming rcmd regardless of outcome
authorDirk Koopman <djk@tobit.co.uk>
Fri, 17 Apr 2020 14:03:22 +0000 (15:03 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 17 Apr 2020 14:03:22 +0000 (15:03 +0100)
perl/DXProt.pm

index 8b9026c1f700e71945feda5329efcf9b2b431f95..78c5526b4ce4fd67f73d4d168a6f0c6bdb00b316 100644 (file)
@@ -1118,6 +1118,8 @@ sub load_hops
 sub process_rcmd
 {
        my ($self, $tonode, $fromnode, $user, $cmd) = @_;
+
+       Log('rcmd', 'in', ($ref->{priv}||0), $fromnode, $cmd);
        if ($tonode eq $main::mycall) {
                my $ref = DXUser::get_current($fromnode);
                unless ($ref && UNIVERSAL::isa($ref, 'DXUser')) {
@@ -1131,7 +1133,6 @@ sub process_rcmd
                        $self->send_rcmd_reply($main::mycall, $fromnode, $user, "sorry...!");
                        return;
                }
-               Log('rcmd', 'in', ($ref->{priv}||0), $fromnode, $cmd);
                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