develooper Front page | perl.perl5.porters | Postings from April 2001

Safe.pm

From:
Joel
Date:
April 30, 2001 00:33
Subject:
Safe.pm
Message ID:
001301c0cb71$7c3895c0$0201a8c0@prime
Hello Tim,

I'm using the Safe.pm module in a situation where I need to be able to sometimes break out of the safe compartment to execute only my specific shared functions.

I'm finding that the shared functions also execute inside the safe compartment with the same opcode restrictions as the compartment itself.  I have tried the Safe::Hole module found on CPAN but it only allows the code to execute outside the compartment.  It is still under the same opcode restrictions as the compartment.

I was wondering if there is a way to get shared functions to execute in the normal program space with the normal full opcodes.  That way from inside the compartment restricted access could be given to specific shared function calls.

For example supposing I didn't want the code in the compartment to be able to access the file system.  I would restrict all the opcodes so that no file access was possible.  But suppose also that I wanted to allow access to just one or two specific files in the file system.  I would like to be able to write a wrapper read_myfile() write_myfile() functions that would execute outside the compartment and have all the opcodes available to it so that they could access the files and do what they need with them.

Whew..I hope that made sense to you?  It's hard to explain but its very simple once you get it.

Anyhow, I hope that you might be able to shed some light on the subject.  I have been at this for weeks now and no one on #perl seems to know anything about Safe.pm and I haven't had much luck with the search engines.  I'm writing to you as a last resort.

Thanks for your time :)

Joel Appelbaum



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About