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#00099

apache.mod-perl.devel

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

Hi,

Make test works OK.

Here's a diff of the standard "cgi-bin/printenv.pl" output from a mod_perl
vs. straight perl :-

> DOWNGRADE_1_0="1"
< downgrade-1.0=""

> FORCE_RESPONSE_1_0="1"
< force-response-1.0=""

> NOKEEPALIVE="1"
< nokeepalive=""

< SSL_SERVER_I_DN_Email=""
> SSL_SERVER_I_DN_EMAIL="steve.sparling@xxxxxxxxx"

< SSL_SERVER_S_DN_Email=""
> SSL_SERVER_S_DN_EMAIL="steve.sparling@xxxxxxxxx"

> SSL_UNCLEAN_SHUTDOWN="1"
< ssl-unclean-shutdown=""

< SystemRoot="C:\WINDOWS"
> SYSTEMROOT="C:\WINDOWS"

Most of these variables come from "mod_ssl" except "SystemRoot" - which
comes from my
standard XP environment.

Notice also, the difference in "-" vs "_" and "." vs "_".

The src I built already had the ENV_IS_CASELESS conversion in
"modperl_cmd.c".

Hope this helps
Cheers
Steve




-----Original Message-----
From: Stas Bekman [mailto:stas@xxxxxxxxxx]
Sent: 07 April 2003 08:29
To: Sparling, Steve (PS, GENS)
Cc: 'dev@xxxxxxxxxxxxxxx'
Subject: Re: Mixed-case environment variables in Win32 don't get handled
corre ctly


Sparling, Steve (PS, GENS) wrote:
> Hi,
>
> Found a problem running mod_perl under Win32: (ME, 2K and XP).
>
> Mixed-case environment variables don't get handled correctly.
>
> They appear in the %ENV, but have no value.
>
> I've also identified in the source where the problem is + how to fix it -
> please find attached bug report.

Thanks Steve. In the future please inline the report, rather attach it.

Does 'make test' pass for you?

What kind of env vars you have a problem with? Where do you set them? Or
which
ones do you expect to exist but they aren't there?

We populate %ENV with:

modperl_env_table_populate(aTHX_ scfg->SetEnv);
modperl_env_table_populate(aTHX_ scfg->PassEnv);

and if PerlOptions +SetupEnv (or SetHandler perl-script) are enabled:

modperl_env_table_populate(aTHX_ r->subprocess_env);

SetEnv is already handling the upcasing. I'm not sure about PassEnv should
we
need to do the same (if so the patch below should do).

As for r->subprocess_env, doesn't httpd already does the right thing?

Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.45
diff -u -r1.45 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c 4 Apr 2003 06:03:07 -0000 1.45
+++ src/modules/perl/modperl_cmd.c 7 Apr 2003 07:23:21 -0000
@@ -223,7 +223,15 @@
{
MP_dSCFG(parms->server);
char *val = getenv(arg);
-
+
+#ifdef ENV_IS_CASELESS /* i.e. WIN32 */
+ /* we turn off env magic during hv_store later, so do this now,
+ * else lookups on keys with lowercase characters will fails
+ * because Perl will uppercase them prior to lookup.
+ */
+ modperl_str_toupper((char *)arg);
+#endif
+

__________________________________________________________________
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