Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 19902
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: burak [...] cpan.org
Cc:
AdminCc:

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



Subject: PerlEx::DBI crashes CGI.pm
Download (untitled) / with headers
text/plain 1.2k
Perl: ActivePerl 5.8.8 build 817 OS: Windows XP Pro SP2 test code: #!/usr/bin/perl -w BEGIN { $ENV{'GATEWAY_INTERFACE'} = "CGI-PerlEx"; } use strict; use PerlEx::DBI; use CGI; my $cgi = CGI->new; print $cgi->param ? 1 : 0; __END__ output: C:\Documents and Settings\burak\Desktop>perlex.pl Can't locate Apache.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/lib/CGI.pm line 194. Compilation failed in require at C:\Documents and Settings\burak\Desktop\perlex.pl line 7. BEGIN failed--compilation aborted at C:\Documents and Settings\burak\Desktop\perlex.pl line 7. PerlEx::DBI sets $ENV{MOD_PERL} to fool DBI, but this breaks CGI.pm. To fix this problem, $PERLEX detection must be added before mod_perl, and it must be used with mod_perl check: C:\Perl\lib>diff CGI.pm CGI2.pm 180a181,183 Show quoted text
> # Turn on special checking for ActiveState's PerlEx > $PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV
{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; Show quoted text
>
182c185 < if (exists $ENV{MOD_PERL}) { --- Show quoted text
> if (exists $ENV{MOD_PERL} && ! $PERLEX) {
198,200d200 < # Turn on special checking for ActiveState's PerlEx < $PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV {'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; <
Download (untitled) / with headers
text/plain 485b
I've just noticed that CGI::Cookie has the same problem. The code at lines 24-26 # Turn on special checking for Doug MacEachern's modperl my $MOD_PERL = 0; if (exists $ENV{MOD_PERL}) { must be written as # Turn on special checking for ActiveState's PerlEx my $PERLEX; $PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV {'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; # Turn on special checking for Doug MacEachern's modperl my $MOD_PERL = 0; if (exists $ENV{MOD_PERL} && ! $PERLEX) {
Bumping with patches :)
Download CGI-Cookie.pm.patch
text/x-diff 705b
--- CGI\Cookie.pm.old 2009-02-22 11:22:04.501667300 +0200 +++ CGI\Cookie.pm 2009-02-22 11:22:36.911667300 +0200 @@ -21,9 +21,14 @@ 'cmp' => \&compare, 'fallback'=>1; +my $PERLEX = 0; +# Turn on special checking for ActiveState's PerlEx +$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; + # Turn on special checking for Doug MacEachern's modperl +# PerlEx::DBI tries to fool DBI by setting MOD_PERL my $MOD_PERL = 0; -if (exists $ENV{MOD_PERL}) { +if (exists $ENV{MOD_PERL} && ! $PERLEX) { if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) { $MOD_PERL = 2; require Apache2::RequestUtil;
Download CGI.pm.patch
text/x-diff 1.2k
--- CGI.pm.old 2008-09-08 18:13:23.000000000 +0300 +++ CGI.pm 2009-02-22 11:08:00.413667300 +0200 @@ -181,8 +181,12 @@ # $NPH++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; $IIS++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; +# Turn on special checking for ActiveState's PerlEx +$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; + # Turn on special checking for Doug MacEachern's modperl -if (exists $ENV{MOD_PERL}) { +# PerlEx::DBI tries to fool DBI by setting MOD_PERL +if (exists $ENV{MOD_PERL} && ! $PERLEX) { # mod_perl handlers may run system() on scripts using CGI.pm; # Make sure so we don't get fooled by inherited $ENV{MOD_PERL} if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) { @@ -198,9 +202,6 @@ } } -# Turn on special checking for ActiveState's PerlEx -$PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-PerlEx/; - # Define the CRLF sequence. I can't use a simple "\r\n" because the meaning # of "\n" is different on different OS's (sometimes it generates CRLF, sometimes LF # and sometimes CR). The most popular VMS web server
Download (untitled) / with headers
text/plain 105b
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.
Thanks, your patches have been applied in my git repo now. Mark
Subject: released, thanks.
I believe this change was released today as part of CGI.pm 3.45. Thanks for the contribution.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.