httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [PATCH] OS/390 vs. CGI revisited.
Date Fri, 26 Nov 1999 15:28:09 GMT
In a recent note, Martin Kraemer said:

> Date: Fri, 26 Nov 1999 00:22:58 +0100
> On Wed, Nov 24, 1999 at 07:32:31PM -0700, wrote:
> > > Look for the #define NEED_HASHBANG_EMUL in ap_config.h! It improves (what
> > I persisted.  Yow!  to compile hashbang emulation on OS/390, I had to
> > do all the casting below.  Am I even on the right track?
> Uh oh! Yes, I saw all the warnings, but I never took the time to "persist"

A compiler that treats these conditions as errors rather than warnings
provides a marvelous incentive.  :-)

> and fix it all. Thanks a lot, I think your patch does it correctly (where
> it had been broken for a long time). I'd suggest we commit your patches
> (after I had the time to recompile and test it on my platform), because
> it looks very good.
I've further examined the getenv() hazard.  I see:
:r ! grep getenv `find src`

    src/modules/standard/mod_env.c:        env_var = getenv(name_ptr);

        commits result to pool storage; this should be the model for
        the general solution.

    src/main/util_script.c:	tz = getenv("TZ");

        promptly commits result to pool storage; safe

    src/main/util_script.c:    if (!(env_path = getenv("PATH"))) {

        Needs repair; causes CGI to fail on OS/390.

    src/main/util_script.c:    if (env_temp = getenv("SystemRoot")) {
    src/main/util_script.c:    if (env_temp = getenv("COMSPEC")) {
    src/main/util_script.c:    if (env_temp = getenv("WINDIR")) {

         Within "#ifdef WIN32".  If it's OK with WIN32, it's OK with me.

    src/modules/standard/mod_rewrite.c:            result = getenv(var+4);

        May need repair; I don't understand the scope of pools involved.

I now feel that my suggestion of "ap_getenv()" is overkill; if not,
it's in the wrong file.  I believe, as I suggested previously, that
util_script.c can be fixed (if I understand the scope of r->pool)
merely by:

    env_path = ap_strdup(r->pool, getenv("PATH"));

I invite suggestions concerning what's needed for mod_rewrite.c.


View raw message