You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/07/15 03:51:12 UTC

Re: WWW Form Bug Report: "SSI exec does not forward result from

Hi thanks for the information and patches. Once again I will forward these
to the developers list for consideration.

Thanks and regards,
rob

-=-=-

>Dear Mr. Hartill
>
>> Well, I've no idea what's going on. I'll forward the problem
>> report to the developers list.
>>
>> In the meantime you might want to try
>>
>> <!--#include virtual="
>>
>> instead
>>
>
>I'm Takaaki Matsumoto, reported SSI exec problem on 30th Jul for NeXT.
>
>I found the wrong code in mod-include.c causes the problem.
>Here is a difference which I have changed.
>==========
>*** apache-1.1.1/src/mod_include.c      Tue Jul  9 12:43:18 1996
>--- apache-1.1.1a/src/mod_include.c     Sun Jul 14 20:03:25 1996
>***************
>*** 506,512 ****
>          return -1;
> 
>      send_fd(f,r);
>!     pfclose(r->pool, f);      /* will wait for zombie when
>                                 * r->pool is cleared
>                                 */
>      return 0;
>--- 506,512 ----
>          return -1;
> 
>      send_fd(f,r);
>!     pfclose(r->connection->pool, f);  /* will wait for zombie when
>                                 * r->pool is cleared
>                                 */
>      return 0;
>===========
>
>Let me explain.
>In function include_cmd() in mod-include.c, include_cmd() calls spawn_child().
>spawn_child() (in alloc.c) notes "FILE f" forwarded from include_cmd() into
>cleanup list using note_cleanups_for_file().
>At this time, "FILE f" is listed into cleanup list of "r->connection->pool".
>After returning from spawn_child() (parent process only), include_cmd()
>calls pfclose() to close "FILE f".
>Include_cmd() calls pfclose() with "r-pool", and pfclose() tries to
>remove cleanup note from cleanup list of r-pool instead of r-connection-pool.
>Cleanup note for "FILE f" in cleanup list of r-connection-pool is still
>remaining.
>Since scope of "FILE f" is auto variable of include_cmd(),
>later in some place, "FILE f" might be fclose()ed again with invalid  
>parameter.
>And might httpd confuses file handling later.
>I changed code to call pfclose() with "r->connection->pool". and it looks
>fixes the problem.
>
>
>I found another wrong code in buff.c.
>I'm not sure that this causes a problem or not, but it looks something wrong.
>===========
>diff -cr apache-1.1.1/src/buff.c apache-1.1.1a/src/buff.c
>*** apache-1.1.1/src/buff.c     Sun Jul 14 17:37:33 1996
>--- apache-1.1.1a/src/buff.c    Sun Jul 14 20:03:54 1996
>***************
>*** 113,119 ****
>      else fb->inbase = NULL;
> 
>      if (flags & B_WR) fb->outbase = palloc(p, fb->bufsiz);
>!     else fb->inbase = NULL;
> 
>      fb->inptr = fb->inbase;
> 
>--- 113,119 ----
>      else fb->inbase = NULL;
> 
>      if (flags & B_WR) fb->outbase = palloc(p, fb->bufsiz);
>!     else fb->outbase = NULL;
> 
>      fb->inptr = fb->inbase;
> 
>===========
>
>Best regards,
>Takaaki Matsumoto
>---
>Takaaki Matsumoto  (TM088JP)
> takaaki@tmnext.linc.or.jp (HOME)    http://www.linc.or.jp/~takaaki/
>PGP Key (id:55887C75) is available on key server or
>   http://www.linc.or.jp/~takaaki/Family/takaaki/takaaki_public.txt
>   fp  : D7 1C DB F6 75 02 9A 45  08 B8 76 7E A5 C6 16 83

-- 
Rob Hartill (robh@imdb.com)
The Internet Movie Database (IMDb)  http://www.imdb.com/
           ...more movie info than you can poke a stick at.