perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: [mp2.0] Win32 ENV still not compatible with mod_cgi
Date Fri, 09 May 2003 04:33:08 GMT
On Fri, 9 May 2003, Stas Bekman wrote:

[ .. ]
> Can anybody on win32 with mod_perl 1.0 and openssl please try
> to fetch $ENV{SSL_SERVER_S_DN_Email} in a simple test script
> once under mod_cgi and once more under mod_perl?

I'm not sure if this reproduces Steve's original situation,
but I just tried the following script:
=========================================================
#!C:/Perl/bin/perl
##
##  printenv -- demo CGI program which just prints its environment
##
use strict;
$ENV{SSL_SERVER_S_DN_Email} = 'randy@theoryx5';
print <<"END";
Content-type: text/html

<HTML><HEAD>
<TITLE>Environment</TITLE>
</HEAD><BODY>
<H3>Environment variables</H3><UL>
END

foreach my $var (sort keys %ENV) {
  my $val = $ENV{$var};
  $val =~ s|\n|\\n|g;
  $val =~ s|"|\\"|g;
  print qq{<LI>${var} = "${val}"</LI>\n}; } print
qq{<LI>SSL_SERVER_S_DN_Email =
"$ENV{SSL_SERVER_S_DN_Email}"</LI>\n}; print
'</UL></BODY></HTML>';
=====================================================================
I get the same behaviour running this as an ordinary cgi script
(under Apache 1.3.27 or Apache 2.0.45), and also under
Apache::Registry under mod_perl 1.27_01-dev and ModPerl::Registry
under mod_perl 1.99_10 (all with openssl). Within the foreach
loop, it comes out as
   SSL_SERVER_S_DN_EMAIL = "randy@theoryx5"
and the last line gets printed as
   SSL_SERVER_S_DN_Email = "randy@theoryx5"

So capitalization of the environment variable keys occurs when
printing things out, but a lookup of environment variables by
keys is case insensitive. So you can't have two distinct
enviroment variables that differ only by case:
   C:\> set ZZZ=aaa
   C:\> set ZZZ
   ZZZ=aaa
   C:\> set zZz=bbb
   C:\> set zZz
   ZZZ=bbb
   C:\> set ZZZ
   ZZZ=bbb

I also tried, rather than setting the environment variable
within the script, setting it thru various combinations of
the Apache directives SetEnv, PassEnv, PerlSetEnv, and
PerlPassEnv, but in all cases it seemed to look up things
up in a case insensitive manner.  

Steve, how, and from where, is the environment variable 
being set?

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message