mod_ruby and RubyPassEnv

P

Pete Yadlowsky

Hi,

We recently ran into a problem caused by mod_ruby's practice of wiping
the environment clean and building it from scratch. A certain Perl CGI
script would get served by an Apache process (v1.3.29, mod_ruby 1.1.2,
AIX4.3) whose environment had previously been scrubbed by mod_ruby. This
particular Perl script expected to see the timezone variable 'TZ', but,
uh-oh, it's not there! In this case, we could get around the problem by
saying:

RubyPassEnv TZ

but in this diverse operating environment it's quite likely there would
be similar incidents with other scripts and other missing environment
variables. So, I modified mod_ruby (ruby_config.c) a bit to accept:

RubyPassEnv *

which instructs it to pass the existing environment in its entirety;
i.e. the contents of char **environ. I just thought I'd pass this idea
along in case someone else finds it useful as well.

There's an entry in mod_ruby's ChangeLog:

2/23/1999:
mod_ruby.c (setup_env): restore environment variables.

which would seem to indicate that, once upon a time, mod_ruby used to
restore the environment. If I'm reading this correctly, why did it stop
doing so? Just wondering.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top