Package: webalizer
Severity: wishlist
Tags: upstream patch

Hi,

I've had some trouble with webalizer and the apache DirectoryIndex
parameter being messed up.  We setup webalizer to generate stats in
a subdir of the site itself, so when the site adds an htaccess
with their own DirectoryIndex in /, webalizer inherits it.  If this
DirectoryIndex doesn't include "index.html", this breaks the webalizer
directory.

Attached patch adds a few lines of code to generate .htaccess in webalizer
directory, overriding any evil DirectoryIndex magic that the main site
could have.

I have already it to upstream (slightly different because of the debian
patching that removes msg_no_open).

-- 
Robert Millan

ACK STORM, S.L.  -  http://www.ackstorm.es/
diff -ur webalizer-2.01.10.old/output.c webalizer-2.01.10/output.c
--- webalizer-2.01.10.old/output.c	2007-02-19 12:23:57.000000000 +0100
+++ webalizer-2.01.10/output.c	2007-02-19 12:25:47.000000000 +0100
@@ -2590,6 +2590,15 @@
    /* now do html stuff... */
    snprintf(index_fname,sizeof(index_fname),"index.%s",html_ext);
 
+   if ( (out_fp=fopen(".htaccess","w")) == NULL)
+   {
+      if (verbose)
+      fprintf(stderr,"%s .htaccess!\n",_("Error: Unable to open file"));
+      return 1;
+   }
+   fprintf(out_fp,"DirectoryIndex %s\n",index_fname);
+   fclose(out_fp);
+
    if ( (out_fp=open_out_file(index_fname)) == NULL)
    {
       if (verbose)

Reply via email to