You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1998/02/02 01:15:38 UTC

File Descriptor Bug in Frontpage Apache module (fwd)

Doesn't impact us at all, but in case anyone cares about that sort of
stuff or sees people whining... 

---------- Forwarded message ----------
>Path: scanner.worldgate.com!news.maxwell.syr.edu!news-peer.gip.net!news-raspail.gip.net!news.gsl.net!gip.net!newscore.univie.ac.at!newsfeed.Austria.EU.net!Austria.EU.net!not-for-mail
>From: "Alexander Mayrhofer" <A....@Austria.EU.net>
>Newsgroups: microsoft.public.frontpage.extensions.unix
>Subject: File Descriptor Bug in Frontpage Apache module
>Date: Fri, 30 Jan 1998 15:07:39 +0100
>Organization: Customer of EUnet Austria
>Lines: 54
>Message-ID: <6a...@news.Austria.EU.net>
>NNTP-Posting-Host: laurel.austria.eu.net
>X-Newsreader: Microsoft Outlook Express 4.72.2002.0
>X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2002.0
>Xref: scanner.worldgate.com microsoft.public.frontpage.extensions.unix:3413      

Hi all!

The apache frontpage module (revision 1.3) contains a small, but impactive
bug. The suidkey file is being opened, but never closed for about ~35 times
(seems to depend on the number of VirtualHost sections in your apache
config).

In my configuration with about 90 virtual hosts, the root apache process
occupies 42 file descriptors. The beast then starts to fork, and every
single child occupies the 42 file descriptors... this makes the whole server
waste about *600* file descriptors...

Applying this patch to mod_frontpage.c in the apache-src-Directory fixes
this bug. My Apache then occupies only about 20% filedescriptors (eigth per
process)  compared to the number without this patch...

You can also get the patch at http://www.Austria.EU.net/~axelm/fp-patch.html

To apply it to your frontpage patched apache, cd into the src directory, and
type

patch < fp-filedes.patch

then make and install the patched apache.

--- snip snip snip (fp-filedes.patch) ---

*** mod_frontpage.c Fri Jan 30 14:16:55 1998
--- mod_frontpage.c.orig Fri Jan 30 14:19:21 1998
***************
*** 497,502 ****
--- 497,508 ----
           */
          for (i = 0;  i < KEYLEN;  i++)
              gszKeyVal[i] = szBuf[i % iCount] ^ szRandom[i %
sizeof(iRandom)];
+  /*
+   * They simply forgot to close the file, costs me hundreds of
+   * file descriptors...
+   * A.Mayrhofer@Austria.EU.net 980130
+   */
+  close(fd);
      }

  #if defined(SUNOS4)

--- snip snip snip ---

CU

Alexander Mayrhofer
EUnet Austria technical operations