Hello,
I'm trying to use DBI in a Safe compartment (see
follow-on code) but that fails.
I gave up after having tried many things, like
different opcode masks.
I cannot figure what goes wrong or what I'm doing wrong.
I'm using Perl 5.8.0 out of a Mandrake 9.0 distribution.
Any help will be most welcome.
NB: Moreover, I thought that lines <6> & <7> meant pretty much the same
(according to the pod) but in fact line <7> makes everything fail
where line <6> makes somethings work. That puzzles me too. Tim ?
Thanks in advance
Franck
Tahiti - French Polynesia
-------------------------------------------
#
# The wrapper program (ran in a normal way)
#
#!/usr/bin/perl
<1> our $file='/home/fpo/langages/perl/safe_dbi.pl';
<2> use Safe;
<3> use Opcode;
<4> use strict;
<5> my $compartment = new Safe;
<6> $compartment->permit(qw(:browse :filesys_open :filesys_write :subprocess
:ownprocess :others :still_to_be_decided :dangerous :base_math ));
<7> #$compartment->mask(Opcode::full_opset());
<8> $compartment->rdo($file);
#
# The program to be ran in a safe compartment
# (/home/fpo/langages/perl/safe_dbi.pl)
#
#!/usr/bin/perl
use CGI ();
use DBI ();
use Digest::MD5 ();
use strict;
sub hello {
print CGI::header(), CGI::start_html(), "\n";
print "Hello world!\n";
}
&hello;
1;
====================================================
ESSENTIAL SOFTWARE - Ing�nierie Informatique
Solutions Linux & Open Source en Polyn�sie fran�aise
----------------------------------------------------
http://www.esoft.pf/
T�l: (689) 562 395 / 541 295
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
"Fiabilisez vos syst�mes informatiques.
Osez Linux, le choix moderne des gouvernements
et des entreprises Fortune 500"
====================================================