httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject Re: Environment handling in mod_rewrite on a Windows platform
Date Mon, 21 Jun 2004 18:46:26 GMT
At 12:17 PM 6/21/2004, Philip Gladstone wrote:
>I discovered that (on Windows) mod_rewrite.c invokes CreateProcess when creating an external
program to handle rewriting requests. It calls CreateProcess and passes 'environ' to be the
environment of the called process.
>Unfortunately, environ is a 'char **' and the argument to CreateProcess is a sequence
of strings of the form 'name=value\0'. This results in the invoked process getting a garbage
environment which can cause problems.
>The fix is simple -- replace environ by 0. This signals that the calling process environment
is to be copied and then used by the new process.

Fix committed for 1.3.32-dev, and is not an issue for 2.0.  While you are
on the subject;

If you had energy to attack it, this module still needs some mutexing
to allow concurrent threads, to avoid corrupting the rewrite cache.  Again,
not an issue in Apache 2.0, but if you were throwing cycles into cleaning 
up this module I'd be happy to review such a patch.  See the ap_xxx_mutex
api's and check #ifdef MULTITHREAD to portably determine if/how we
create this protection around the rewrite cache.



View raw message