You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2003/04/15 10:53:35 UTC

Re: Mixed-case environment variables in Win32 don't get handled c orrectly

steve.sparling@ps.ge.com wrote:
> Thanks for your quick reply:-
> 
> I don't have access to a diff with a "-u" option - :(

No problem. Your further explanation now makes things clear.

> But the diff was showing the output from mod_perl versus mod_cgi.
> 
> All the keys in UPPERCASE come from mod_cgi.
> 
> 	DOWNGRADE_1_0="1"
> 	FORCE_RESPONSE_1_0="1"
> 	NOKEEPALIVE="1"
> 	SSL_SERVER_I_DN_EMAIL="steve.sparling@ps.ge.com"
> 	SSL_SERVER_S_DN_EMAIL="steve.sparling@ps.ge.com"
> 	SSL_UNCLEAN_SHUTDOWN="1"
> 	SYSTEMROOT="C:\WINDOWS"
> 
> All the keys in MixedCase come from mod_perl.
> 
> 	downgrade-1.0=""
> 	force-response-1.0=""
> 	nokeepalive=""
> 	SSL_SERVER_I_DN_Email=""
> 	SSL_SERVER_S_DN_Email=""
> 	ssl-unclean-shutdown=""
> 	SystemRoot="C:\WINDOWS"

mod_cgi calls ap_create_environment() which performs this mangling.

what's sure is that we need to do that for $r->subprocess_env for all 
platforms. So we stay 1:1 with mod_cgi on all platforms.

I wonder if we should call ap_create_environment's equivalent for 
PerlSetEnv/PerlPassEnv (need to check the SetEnv/PassEnv functionality)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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


Re: Mixed-case environment variables in Win32 don't get handled c orrectly

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> steve.sparling@ps.ge.com wrote:
> 
>> Thanks for your quick reply:-
>>
>> I don't have access to a diff with a "-u" option - :(
> 
> 
> No problem. Your further explanation now makes things clear.
> 
>> But the diff was showing the output from mod_perl versus mod_cgi.
>>
>> All the keys in UPPERCASE come from mod_cgi.
>>
>>     DOWNGRADE_1_0="1"
>>     FORCE_RESPONSE_1_0="1"
>>     NOKEEPALIVE="1"
>>     SSL_SERVER_I_DN_EMAIL="steve.sparling@ps.ge.com"
>>     SSL_SERVER_S_DN_EMAIL="steve.sparling@ps.ge.com"
>>     SSL_UNCLEAN_SHUTDOWN="1"
>>     SYSTEMROOT="C:\WINDOWS"
>>
>> All the keys in MixedCase come from mod_perl.
>>
>>     downgrade-1.0=""
>>     force-response-1.0=""
>>     nokeepalive=""
>>     SSL_SERVER_I_DN_Email=""
>>     SSL_SERVER_S_DN_Email=""
>>     ssl-unclean-shutdown=""
>>     SystemRoot="C:\WINDOWS"
> 
> 
> mod_cgi calls ap_create_environment() which performs this mangling.

I can see that ap_create_environment does s/\W/_/g:

	env[j] = apr_pstrcat(p, elts[i].key, "=", elts[i].val, NULL);
	whack = env[j];
	if (apr_isdigit(*whack)) {
	    *whack++ = '_';
	}
	while (*whack != '=') {
	    if (!apr_isalnum(*whack) && *whack != '_') {
		*whack = '_';
	    }
	    ++whack;
	}
	++j;

But I can't see where it calls toupper to get the upcased vars (for those that 
you have listed). Can you trace which code does that?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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