App-EvalServerAdvanced

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Test::Pod" : "1.41"
         }
      },
      "runtime" : {
         "requires" : {
            "App::EvalServerAdvanced::ConstantCalc" : "0",
            "App::EvalServerAdvanced::Protocol" : "0",
            "B::Deparse" : "0",
            "BSD::Resource" : "0",
            "Carp" : "0",
            "Data::Dumper" : "0",
            "Exporter" : "0",
            "Fcntl" : "0",
            "File::Copy::Recursive" : "0",
            "File::ShareDir" : "0",
            "Function::Parameters" : "0",
            "Getopt::Long" : "0",
            "IO::Async::Function" : "0",
            "IO::Async::Loop" : "0",
            "IO::Handle" : "0",
            "IPC::Run" : "0",

META.yml  view on Meta::CPAN

    version: '0.024'
  App::EvalServerAdvanced::Seccomp::Syscall:
    file: lib/App/EvalServerAdvanced/Seccomp/Syscall.pm
    version: '0.024'
requires:
  App::EvalServerAdvanced::ConstantCalc: '0'
  App::EvalServerAdvanced::Protocol: '0'
  B::Deparse: '0'
  BSD::Resource: '0'
  Carp: '0'
  Data::Dumper: '0'
  Exporter: '0'
  Fcntl: '0'
  File::Copy::Recursive: '0'
  File::ShareDir: '0'
  Function::Parameters: '0'
  Getopt::Long: '0'
  IO::Async::Function: '0'
  IO::Async::Loop: '0'
  IO::Handle: '0'
  IPC::Run: '0'

Makefile.PL  view on Meta::CPAN

  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.020000",
  "NAME" => "App::EvalServerAdvanced",
  "PREREQ_PM" => {
    "App::EvalServerAdvanced::ConstantCalc" => 0,
    "App::EvalServerAdvanced::Protocol" => 0,
    "B::Deparse" => 0,
    "BSD::Resource" => 0,
    "Carp" => 0,
    "Data::Dumper" => 0,
    "Exporter" => 0,
    "Fcntl" => 0,
    "File::Copy::Recursive" => 0,
    "File::ShareDir" => 0,
    "Function::Parameters" => 0,
    "Getopt::Long" => 0,
    "IO::Async::Function" => 0,
    "IO::Async::Loop" => 0,
    "IO::Handle" => 0,
    "IPC::Run" => 0,

Makefile.PL  view on Meta::CPAN

  }
);


my %FallbackPrereqs = (
  "App::EvalServerAdvanced::ConstantCalc" => 0,
  "App::EvalServerAdvanced::Protocol" => 0,
  "B::Deparse" => 0,
  "BSD::Resource" => 0,
  "Carp" => 0,
  "Data::Dumper" => 0,
  "Exporter" => 0,
  "ExtUtils::MakeMaker" => 0,
  "Fcntl" => 0,
  "File::Copy::Recursive" => 0,
  "File::ShareDir" => 0,
  "File::Spec" => 0,
  "Function::Parameters" => 0,
  "Getopt::Long" => 0,
  "IO::Async::Function" => 0,
  "IO::Async::Loop" => 0,

README.pod  view on Meta::CPAN

use IO::Async::Loop;
use IO::Async::Function;
use App::EvalServerAdvanced::Config;
use App::EvalServerAdvanced::Sandbox;
use App::EvalServerAdvanced::JobManager;
use Function::Parameters;
use App::EvalServerAdvanced::Protocol;
use App::EvalServerAdvanced::Log;
use Syntax::Keyword::Try;

use Data::Dumper;
use POSIX qw/_exit/;

use Moo;
use IPC::Run qw/harness/;

has loop => (is => 'ro', lazy => 1, default => sub {IO::Async::Loop->new()});
has _inited => (is => 'rw', default => 0);
has jobman => (is => 'ro', default => sub {App::EvalServerAdvanced::JobManager->new(loop => $_[0]->loop)});
has listener => (is => 'rw');

lib/App/EvalServerAdvanced.pm  view on Meta::CPAN

use IO::Async::Loop;
use IO::Async::Function;
use App::EvalServerAdvanced::Config;
use App::EvalServerAdvanced::Sandbox;
use App::EvalServerAdvanced::JobManager;
use Function::Parameters;
use App::EvalServerAdvanced::Protocol;
use App::EvalServerAdvanced::Log;
use Syntax::Keyword::Try;

use Data::Dumper;
use POSIX qw/_exit/;

use Moo;
use IPC::Run qw/harness/;

has loop => (is => 'ro', lazy => 1, default => sub {IO::Async::Loop->new()});
has _inited => (is => 'rw', default => 0);
has jobman => (is => 'ro', default => sub {App::EvalServerAdvanced::JobManager->new(loop => $_[0]->loop)});
has listener => (is => 'rw');

lib/App/EvalServerAdvanced/JobManager.pm  view on Meta::CPAN

package App::EvalServerAdvanced::JobManager;

use v5.20;
use strict;
use warnings;
use feature qw(postderef);
no warnings qw(experimental::postderef);

our $VERSION = '0.024';

use Data::Dumper;
use Moo;
use App::EvalServerAdvanced::Config;
use App::EvalServerAdvanced::Log;
use Function::Parameters;
use POSIX qw/dup2 _exit/;
use IO::Handle;

has loop => (is => 'ro');
has workers => (is => 'ro', builder => sub {+{}});
has jobs => (is => 'ro', builder => sub {+{}});

lib/App/EvalServerAdvanced/Sandbox.pm  view on Meta::CPAN

use Path::Tiny qw/path/;
use BSD::Resource;
use Unix::Mknod qw/makedev mknod/;
use Fcntl qw/:mode/;

use App::EvalServerAdvanced::Log;
use App::EvalServerAdvanced::Config;
use App::EvalServerAdvanced::Sandbox::Internal;
use App::EvalServerAdvanced::Seccomp;
use POSIX qw/_exit/;
use Data::Dumper;
use Sys::Linux::Syscall::Execve qw/execve_byref/;

my %sig_map;
do {
  my @sig_names = split ' ', $Config{sig_name};
  my @sig_nums = split ' ', $Config{sig_num};
  @sig_map{@sig_nums} = map {'SIG' . $_} @sig_names;
  $sig_map{31} = "SIGSYS (Illegal Syscall)";
};

lib/App/EvalServerAdvanced/Sandbox/Internal.pm  view on Meta::CPAN

processing is needed.

=head1 TEMPLATING CODE

You can also use this to template the code being passed to an external interpreter.

    sub perl_wrap {
        my ($class, $lang, $code) = @_;
        my $qcode = quotemeta $code;

        my $wrapper = 'use Data::Dumper;

        local $Data::Dumper::Terse = 1;
        local $Data::Dumper::Quotekeys = 0;
        local $Data::Dumper::Indent = 0;
        local $Data::Dumper::Useqq = 1;

        my $val = eval "#line 1 \"(IRC)\"\n'.$qcode.'";

        if ($@) {
          print $@;
        } else {
          $val = ref($val) ? Dumper ($val) : "".$val;
          print " ",$val;
        }
        ';

lib/App/EvalServerAdvanced/Sandbox/Plugin/Perlbot.pm  view on Meta::CPAN

package App::EvalServerAdvanced::Sandbox::Plugin::Perlbot;

use strict;
use warnings;
use Moo::Role;

use Data::Dumper;
use B::Deparse;
use Perl::Tidy;
use PerlIO;
do {my $temp; open(my $fh, ">", \$temp); close($fh)};

sub deparse_perl_code {
    my( $class, $lang, $code ) = @_;
    my $sub;
    {
        no strict; no warnings; no charnames;

lib/App/EvalServerAdvanced/Sandbox/Plugin/Perlbot.pm  view on Meta::CPAN

            $err = $@;
        }
    }
    select STDOUT;



    if (length($outbuffer) > 0) {
        print $outbuffer;
    } else {
        local $Data::Dumper::Terse = 1;
        local $Data::Dumper::Quotekeys = 0;
        local $Data::Dumper::Indent = 0;
        local $Data::Dumper::Useqq = 1;
        local $Data::Dumper::Freezer = "dd_freeze";

        no warnings;
        my $out = ref($ret) ? Dumper( $ret ) : "" . $ret;
    
      print $out;
    }

    if( $err ) { print "ERROR: $err" }
}

sub perl_wrap {
    my ($class, $lang, $code) = @_;
    my $qcode = quotemeta $code;

    my $wrapper = 'use Data::Dumper; 
    
		local $Data::Dumper::Terse = 1;
		local $Data::Dumper::Quotekeys = 0;
		local $Data::Dumper::Indent = 0;
		local $Data::Dumper::Useqq = 1;

    my $val = eval "#line 1 \"(IRC)\"\n'.$qcode.'";

    if ($@) {
      print $@;
    } else {
      $val = ref($val) ? Dumper ($val) : "".$val;
      print " ",$val;
    }
    ';

lib/App/EvalServerAdvanced/Seccomp.pm  view on Meta::CPAN

package App::EvalServerAdvanced::Seccomp;
our $VERSION = '0.024';

use strict;
use warnings;

use v5.20;

use Data::Dumper;
use List::Util qw/reduce uniq/;
use Moo;
#use Linux::Clone;
#use POSIX ();
use Linux::Seccomp;
use Carp qw/croak/;
use Module::Runtime qw/check_module_name require_module module_notional_filename/;
use App::EvalServerAdvanced::Config;
use App::EvalServerAdvanced::ConstantCalc;
use App::EvalServerAdvanced::Seccomp::Profile;

lib/App/EvalServerAdvanced/Seccomp/Syscall.pm  view on Meta::CPAN

package App::EvalServerAdvanced::Seccomp::Syscall;
use Moo;
use Function::Parameters;
use Permute::Named::Iter qw/permute_named_iter/;
use Data::Dumper;

has syscall => (is => 'ro', required => 1);
has tests => (is => 'ro', default => sub {[]});
has action => (is => 'ro', default => "ALLOW");

# take the test and return however many seccomp rules it needs.  doing any permutated arguments, and looking up of constants
method resolve_syscall($seccomp) {
  my @rendered_tests;

  my %permuted_on;

seccomptest.pl  view on Meta::CPAN


use strict;
use warnings;
use lib './lib';
use App::EvalServerAdvanced::Seccomp;
$App::EvalServerAdvanced::Config::config_dir = '/home/ryan//workspace/evalserver-async/serverapp/testsandbox/sandbox/etc';

my $seccomp = App::EvalServerAdvanced::Seccomp->new();
$seccomp->load_yaml('/home/ryan//workspace/evalserver-async/serverapp/skel-sandbox/etc/seccomp.yaml');

use Data::Dumper;
$seccomp->build_seccomp;
$seccomp->apply_seccomp("lang_perl");
#print Dumper($seccomp);

t/00-report-prereqs.dd  view on Meta::CPAN

                                      'Test::Pod' => '1.41'
                                    }
                    },
       'runtime' => {
                      'requires' => {
                                      'App::EvalServerAdvanced::ConstantCalc' => '0',
                                      'App::EvalServerAdvanced::Protocol' => '0',
                                      'B::Deparse' => '0',
                                      'BSD::Resource' => '0',
                                      'Carp' => '0',
                                      'Data::Dumper' => '0',
                                      'Exporter' => '0',
                                      'Fcntl' => '0',
                                      'File::Copy::Recursive' => '0',
                                      'File::ShareDir' => '0',
                                      'Function::Parameters' => '0',
                                      'Getopt::Long' => '0',
                                      'IO::Async::Function' => '0',
                                      'IO::Async::Loop' => '0',
                                      'IO::Handle' => '0',
                                      'IPC::Run' => '0',



( run in 0.323 second using v1.01-cache-2.11-cpan-4d50c553e7e )