Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

RE: Mixed-case environment variables in Win32 don't get handled c orrectly: msg#00110

apache.mod-perl.devel

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

Hi,

Can't find any code explicitly in Apache which uppercases the key.

I think that because mod_cgi calls "ap_os_create_privileged_process()" to
run the
perl interpreter, it ultimately calls the Win32 api CreateProcess(), which
takes
an environment block as a parameter.

It must be within this API that conversion to uppercase is performed.

So, you probably need to "emulate" this behaviour for Win32 since mod_perl
doesn't call
CreateProcess() - one of the main / major / only reasons for using
mod_perl.....

Hope that this might help.
Cheers
Steve



-----Original Message-----
From: Stas Bekman [mailto:stas@xxxxxxxxxx]
Sent: 15 April 2003 10:41
Cc: Sparling, Steve (PS, GENS); dev@xxxxxxxxxxxxxxx
Subject: Re: Mixed-case environment variables in Win32 don't get handled
c orrectly


Stas Bekman wrote:
> steve.sparling@xxxxxxxxx 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@xxxxxxxxx"
>> SSL_SERVER_S_DN_EMAIL="steve.sparling@xxxxxxxxx"
>> 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@xxxxxxxxxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation