Select an installed module below |
NAMESafe - Compile and execute code in restricted compartments
SYNOPSISuse Safe; $compartment = new Safe; $compartment->permit(qw(time sort :browse)); $result = $compartment->reval($unsafe_code);
DESCRIPTIONThe Safe extension module allows the creation of compartments in which perl code can be evaluated. Each compartment has
WARNINGThe authors make no warranty, implied or otherwise, about the suitability of this software for safety or security purposes. The authors shall not in any case be liable for special, incidental, consequential, indirect or other similar damages arising from the use of this software. Your mileage will vary. If in any doubt do not use it.
RECENT CHANGESThe interface to the Safe module has changed quite dramatically since version 1 (as supplied with Perl5.002). Study these pages carefully if you have code written to use Safe version 1 because you will need to makes changes.
Methods in class SafeTo create a new compartment, use
$cpt = new Safe;
Optional argument is (NAMESPACE), where NAMESPACE is the root namespace to use for the compartment (defaults to ``Safe::Root0'', incremented for each new compartment). Note that version 1.00 of the Safe module supported a second optional parameter, MASK. That functionality has been withdrawn pending deeper consideration. Use the permit and deny methods described below. The following methods can then be used on the compartment object returned by the above constructor. The object argument is implicit in each case.
Some Safety IssuesThis section is currently just an outline of some of the things code in a compartment might do (intentionally or unintentionally) which can have an effect outside the compartment.
AUTHOROriginally designed and implemented by Malcolm Beattie, mbeattie@sable.ox.ac.uk. Reworked to use the Opcode module and other changes added by Tim Bunce <Tim.Bunce@ig.co.uk>.
|
|