Skip Menu |

This queue is for tickets about the CGI-CRUD CPAN distribution.

Report information
The Basics
Id: 78826
Status: open
Priority: 0/
Queue: CGI-CRUD

People
Owner: Nobody in particular
Requestors: DHUDES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.06
Fixed in: (no value)



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.
You might be interested in my bug report here, which both had a patch to do what you did, and also where I discovered you can set the data in a Perl Begin statement: https://rt.cpan.org/Ticket/Display.html?id=57081 I don't know if the Begin stuff works with SuExec, but if not, the patch may be of use instead.