Ok, forget my post, her's the answer:
#!/usr/bin/perl -w
use Safe;
my $page = new Safe ("huhu");
my $opset = Opcode::opset qw(:base_io :base_orig :base_thread
:filesys_read :sys_db
:filesys_open :filesys_write :subprocess :ownprocess
:still_to_be_decided :dangerous);
$page->deny(Opcode::opset_to_ops($opset));
$page->permit qw(print ref );
$page->deny (qw(rand srand));
$page->reval ("eval \" print 'huhu' \"");
print $@."\n";
Martin Haase-Thomas wrote:
> Hi all,
>
> maybe this is really far WOT, but one shouldn't give up hope, as we
> all know...
> Does anyone have experience with Opcode and Safe? The thing is that I
> have to create my own secure namespace
> for some reasons - and don't know how to do.
>
> What does not work is the following:
>
> #!/usr/bin/perl -w
> use Safe;
> my $page = new Safe ("huhu");
> $page->deny qw(:base_io :base_orig :base_thread :filesys_read :sys_db
> :filesys_open :filesys_write :subprocess :ownprocess
> :still_to_be_decided :dangerous);
> $page->permit qw(print ref entereval);
> $page->deny qw(rand srand);
> $page->reval ("sysopen '/bla/blub.html' || kill 15, 1906");
>
> Anyone with an idea? btw: funny things will happen if you type 1
> instead of 1906 ... :)
>
> regards
> Martin
>
--
http://www.meome.de
-------------------------------------------------------
Martin Haase-Thomas | Tel.: 030 43730-558
meOme AG | Fax.: 030 43730-555
Software Development | [EMAIL PROTECTED]
-------------------------------------------------------