Subject: | Environment variables are incompatible with SuExec |
The module CGI::CRUD::CGIOutputFastTemplate opens the DBI connection
relying on the use of environment variables to provide the information
DBI needs to make the connection to the database. This is incompatible
with SuExec. You can't rely on custom environment vriables in an SuExec
environment. See the Apache documentation
http://httpd.apache.org/docs/2.2/env.html where it states under Caveats:
"When suexec is used to launch CGI scripts, the environment will be
cleaned down to a set of safe variables before CGI scripts are launched.
The list of safe variables is defined at compile-time in suexec.c"
Relying on environment variables is not the most appropriate programming
practice for a module. Configuration files can be made even per database
user which is not necessarily the same as the user who is running the
code. Use of configuration files separates web server configuration from
application configuration.
Cruddy and CGI::CRUD look interesting for their purpose and worth
putting some effort into so I will develop a fix and submit a patch to
turn cruddy.pl into using a config file and the module into taking the
DSN as a mandatory part of the constructor.