httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Gladstone <pgladst...@cisco.com>
Subject Environment handling in mod_rewrite on a Windows platform
Date Mon, 21 Jun 2004 17:17:58 GMT
Hi,

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.

This problem is definitely present in 1.3.31. I did not check 2.0.x.

Philip
-- 
Philip Gladstone                    978-ZEN-TOAD (978-936-8623)
Cisco Systems, Inc                                  Boxboro, MA

Mime
View raw message