/usr/lib/znc/perleval.pm is in znc-perl 1.6.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | use strict;
use warnings;
package perleval;
use base 'ZNC::Module';
sub description {
'Evaluates perl code'
}
sub wiki_page {
'perleval'
}
sub OnLoad {
my $self = shift;
if (!$self->GetUser->IsAdmin) {
$_[1] = 'Only admin can load this module';
return 0
}
return 1
}
sub OnModCommand {
my $self = shift;
my $cmd = shift;
my $x = eval $cmd;
if ($@) {
$self->PutModule("Error: $@")
} else {
$self->PutModule("Result: $x")
}
}
1
|