mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 16:35:40 -04:00
changes to add modules and make things a little more "secure" (obscure)
This commit is contained in:
parent
4d36c46741
commit
63fedb24de
4 changed files with 23 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use lib '/home/farnsworth/perl5/lib/perl5';
|
||||||
|
use local::lib;
|
||||||
# Guess we're being activated inside bin/, so go up a directory.
|
# Guess we're being activated inside bin/, so go up a directory.
|
||||||
BEGIN { if( not -e 'lib' and not -e 'etc' and -e 'bb3' ) { chdir ".."; } }
|
BEGIN { if( not -e 'lib' and not -e 'etc' and -e 'bb3' ) { chdir ".."; } }
|
||||||
|
|
||||||
|
@ -7,6 +9,8 @@ use lib 'lib';
|
||||||
use EvalServer;
|
use EvalServer;
|
||||||
use POSIX qw/setsid/;
|
use POSIX qw/setsid/;
|
||||||
|
|
||||||
|
$ENV{PATH}="/usr/bin/:/bin/";
|
||||||
|
|
||||||
# Only daemonize if we're asked to.
|
# Only daemonize if we're asked to.
|
||||||
if( $ARGV[0] eq '-d' ) {
|
if( $ARGV[0] eq '-d' ) {
|
||||||
# Crude daemonization
|
# Crude daemonization
|
||||||
|
|
5
deps/build_deps.sh
vendored
5
deps/build_deps.sh
vendored
|
@ -16,9 +16,8 @@ cd ../..
|
||||||
cd JavaScript-SpiderMonkey-0.19-patched
|
cd JavaScript-SpiderMonkey-0.19-patched
|
||||||
perl Makefile.PL
|
perl Makefile.PL
|
||||||
make
|
make
|
||||||
make test
|
make test && make install
|
||||||
sudo make install
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
|
||||||
sudo cpan Log::Log4perl
|
#sudo cpan Log::Log4perl
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
package EvalServer;
|
package EvalServer;
|
||||||
|
|
||||||
|
use lib '/home/farnsworth/perl5/lib/perl5/';
|
||||||
|
$ENV{PERL5LIB}="/home/farnsworth/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:/home/farnsworth/perl5/lib/perl5";
|
||||||
use POE;
|
use POE;
|
||||||
use POE::Wheel::SocketFactory;
|
use POE::Wheel::SocketFactory;
|
||||||
use POE::Wheel::ReadWrite;
|
use POE::Wheel::ReadWrite;
|
||||||
|
|
16
lib/eval.pl
16
lib/eval.pl
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
|
||||||
use lib '/home/ryan/perl5/lib/perl5';
|
use lib '/home/farnsworth/perl5/lib/perl5/x86_64-linux-gnu-thread-multi';
|
||||||
|
use lib '/home/farnsworth/perl5/lib/perl5';
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
@ -9,6 +10,16 @@ use BSD::Resource;
|
||||||
use File::Glob;
|
use File::Glob;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
|
|
||||||
|
use List::Util;
|
||||||
|
use List::MoreUtils;
|
||||||
|
use List::UtilsBy;
|
||||||
|
use Data::Munge;
|
||||||
|
use Scalar::MoreUtils;
|
||||||
|
|
||||||
|
require Moose;
|
||||||
|
require MooseX::Declare;
|
||||||
|
no warnings;
|
||||||
|
|
||||||
# This sub is defined here so that it is defined before the 'use charnames'
|
# This sub is defined here so that it is defined before the 'use charnames'
|
||||||
# command. This causes extremely strange interactions that result in the
|
# command. This causes extremely strange interactions that result in the
|
||||||
# deparse output being much longer than it should be.
|
# deparse output being much longer than it should be.
|
||||||
|
@ -129,7 +140,7 @@ use Storable qw/nfreeze/; nfreeze([]); #Preload Nfreeze since it's loaded on dem
|
||||||
|
|
||||||
my $kilo = 1024;
|
my $kilo = 1024;
|
||||||
my $meg = $kilo * $kilo;
|
my $meg = $kilo * $kilo;
|
||||||
my $limit = 50 * $meg;
|
my $limit = 150 * $meg;
|
||||||
|
|
||||||
(
|
(
|
||||||
setrlimit(RLIMIT_DATA, $limit, $limit )
|
setrlimit(RLIMIT_DATA, $limit, $limit )
|
||||||
|
@ -156,6 +167,7 @@ use Storable qw/nfreeze/; nfreeze([]); #Preload Nfreeze since it's loaded on dem
|
||||||
)
|
)
|
||||||
or die "Failed to set rlimit: $!";
|
or die "Failed to set rlimit: $!";
|
||||||
|
|
||||||
|
%ENV=();
|
||||||
#setrlimit(RLIMIT_MSGQUEUE,100,100);
|
#setrlimit(RLIMIT_MSGQUEUE,100,100);
|
||||||
|
|
||||||
die "Failed to drop root: $<" if $< == 0;
|
die "Failed to drop root: $<" if $< == 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue