See TourOfAnSPWRun.
/var/www/spw.pl
: the wrapper file which is called by the webserver first. It sets up a [[Safe_compartment?]], then calls /var/www/UsemodUnsafeInit.pl
within it to do some initialization. Next it restricts the future operation of the Safe compartment to certain commands, as described on PerlSafe. Then it "shares" some subroutines from /var/www/UsemodUnsafe.pm
with the compartment, as described on PerlSafe. Finally, it calls /spw/spw_main
./var/www/spw.pl
is owned by root and may not be modified by the spw
user./var/www/UsemodUnsafeInit.pl
: Does some initialization of the Safe compartment which requires too many privilages to be done by the main code (such as loading in Modules)/var/www/UsemodUnsafe.pm
: Has routines that let the main program do some limited file and network I/O even though the main program itself is prohibited from doing these things directly by the Safe restrictions. Basically, it lets the main program do file I/O, but only under the /spw
directory./spw/spw_main.pl
: This is the main code. Right now it is just UseMod, with prohibited operations replaced by calls to /var/www/UsemodUnsafe.pm