| Sys-Protect documentation | Contained in the Sys-Protect distribution. |
Sys::Protect - deny a bunch of opcodes
use Sys::Protect;
Artur Bergman, <sky@crucially.net>
Brad Fitzpatrick, <brad@danga.com>
Various other people at NPW 2004 helped with ideas and suggestions.
Copyright 2004 by Artur Bergman
Copyright 2008 by Artur Bergman, Brad Fitzpatrick
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Sys-Protect documentation | Contained in the Sys-Protect distribution. |
package Sys::Protect; our $VERSION; use Carp qw(confess); our %allowed; BEGIN { for (qw( Time::HiRes version Cwd Data::Dumper Digest::MD5 Digest::SHA Encode Hash::Util I18N::Langinfo List::Util Mime::Base64 Math::BigInt::FastCalc Storable )) { $allowed{$_}++; } # re? }; BEGIN { require XSLoader; $VERSION = '0.02'; XSLoader::load('Sys::Protect', $VERSION); no warnings 'redefine'; my $xsloader_load_orig = \&XSLoader::load; my $dynaloder_bootstrap_orig = \&DynaLoader::bootstrap; *XSLoader::load = sub { if ( $allowed{$_[0]} ) { $xsloader_load_orig->(@_); } else { confess "Not allowed to load $_[0]"; } }; *DynaLoader::bootstrap = sub { if ( $allowed{$_[0]} ) { $dynaloder_bootstrap_orig->(@_); } else { confess "Not allowed to bootstrap $_[0]"; } }; }; use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use 5.008; use strict; use warnings; { use Exporter (); @ISA = qw(Exporter); } # Preloaded methods go here. # Autoload methods go after =cut, and are processed by the autosplit program. 1; __END__ # Below is stub documentation for your module. You'd better edit it!