Revision bump; added a sleu of upstream patches to fix various bugs. Added a patch...
authorAaron Walker <ka0ttic@gentoo.org>
Sat, 27 Aug 2005 12:36:13 +0000 (12:36 +0000)
committerAaron Walker <ka0ttic@gentoo.org>
Sat, 27 Aug 2005 12:36:13 +0000 (12:36 +0000)
Package-Manager: portage-1.589-cvs

18 files changed:
www-servers/lighttpd/ChangeLog
www-servers/lighttpd/Manifest
www-servers/lighttpd/files/1.4.1/01_all_any-fam.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/02_all_optional_pcre.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/03_all_mod_cgi-wait.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/04_all_mod_cgi-create-env-once.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/05_all_fix_array_merging.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/06_all_check-for-waiting-write.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/07_all_fix-dst_addr_buf-leak.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/08_all_doc-updates.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/09_all_lfs-range-requests.diff [new file with mode: 0644]
www-servers/lighttpd/files/1.4.1/10_all_stat_cache_init_after_setuid.diff [new file with mode: 0644]
www-servers/lighttpd/files/conf/lighttpd.conf
www-servers/lighttpd/files/conf/mime-types.conf
www-servers/lighttpd/files/conf/mod_cgi.conf [new file with mode: 0644]
www-servers/lighttpd/files/conf/mod_fastcgi.conf
www-servers/lighttpd/files/digest-lighttpd-1.4.1-r1 [moved from www-servers/lighttpd/files/digest-lighttpd-1.4.1 with 100% similarity]
www-servers/lighttpd/lighttpd-1.4.1-r1.ebuild [moved from www-servers/lighttpd/lighttpd-1.4.1.ebuild with 62% similarity]

index cf51602a164809bcb3d320dfd021929a4beec3b5..f07354897922bdf462a7faa5ca508c28cb744bdf 100644 (file)
@@ -1,6 +1,27 @@
 # ChangeLog for www-servers/lighttpd
 # Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/ChangeLog,v 1.36 2005/08/23 01:21:48 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/ChangeLog,v 1.37 2005/08/27 12:36:13 ka0ttic Exp $
+
+*lighttpd-1.4.1-r1 (27 Aug 2005)
+
+  27 Aug 2005; Aaron Walker <ka0ttic@gentoo.org>
+  +files/1.4.1/01_all_any-fam.diff, +files/1.4.1/03_all_mod_cgi-wait.diff,
+  +files/1.4.1/07_all_fix-dst_addr_buf-leak.diff,
+  +files/1.4.1/02_all_optional_pcre.diff,
+  +files/1.4.1/04_all_mod_cgi-create-env-once.diff,
+  +files/1.4.1/05_all_fix_array_merging.diff,
+  +files/1.4.1/06_all_check-for-waiting-write.diff,
+  +files/1.4.1/08_all_doc-updates.diff,
+  +files/1.4.1/09_all_lfs-range-requests.diff,
+  +files/1.4.1/10_all_stat_cache_init_after_setuid.diff,
+  files/conf/lighttpd.conf, files/conf/mime-types.conf,
+  +files/conf/mod_cgi.conf, files/conf/mod_fastcgi.conf,
+  -lighttpd-1.4.1.ebuild, +lighttpd-1.4.1-r1.ebuild:
+  Revision bump; added a sleu of upstream patches to fix various bugs. Added a
+  patch to make pcre support optional (although it's highly recommended). FAM
+  support now falls back to fam if gamin is unavailable, so we're now able to
+  use virtual/fam (fixes bug #103643). Also fixes several problems with the
+  custom gentoo configuration.
 
   23 Aug 2005; Aaron Walker <ka0ttic@gentoo.org> lighttpd-1.4.1.ebuild:
   Don't use check-kernel.eclass.
index 24e87355d0ad45637521092de8912dab03f9a81e..435ba72a7ea4620d176d6f7781830fdd6da679ff 100644 (file)
@@ -1,10 +1,10 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
+MD5 6c23268afc8a8db6cc2fba589ca10d8e lighttpd-1.4.1-r1.ebuild 4166
 MD5 81af13d45943a9638f0d7de071256bf8 lighttpd-1.3.16.ebuild 2549
 MD5 49ded22216ffc6092d1a1e04a6e420c1 lighttpd-1.3.13-r3.ebuild 2607
-MD5 9c3e9269d6b586681d2dac764a336288 lighttpd-1.4.1.ebuild 3989
-MD5 22a8d647c75b7b9fb2a22a9f6a45d996 ChangeLog 10606
+MD5 acf6ed3f40bb5fbca205702f4c0cc81e ChangeLog 11659
 MD5 6a9d4814404d8d51327e5b8306ee3d7e metadata.xml 726
 MD5 1d925aed297ec4541fb230dd19e11bc1 files/spawn-fcgi.confd 1076
 MD5 f984dc26b2bc491272d302ab453f6e6b files/lighttpd-1.3.13-ldap-binddn.diff 3863
@@ -17,17 +17,28 @@ MD5 77ba3937d1e8762f8d8b6b2ea9ee1aaa files/digest-lighttpd-1.3.13-r3 67
 MD5 c54a6d92e91493bbb27e8f346f6ac342 files/digest-lighttpd-1.3.16 67
 MD5 5eb378dcd8905a09175df3e48953100c files/lighttpd-1.3.13-zope-deserves-lovins-too.diff 5970
 MD5 cd47f8973299bf15bed4677b430ffcc5 files/lighttpd.initd 1009
-MD5 505de9ff2c21c63f75afbc4b79deaa81 files/digest-lighttpd-1.4.1 66
 MD5 0c57eeef1963af5add8b9608e0bc0d0f files/lighttpd-1.3.13-no-mysql-means-no-mysql.diff 1456
+MD5 505de9ff2c21c63f75afbc4b79deaa81 files/digest-lighttpd-1.4.1-r1 66
 MD5 44374d14af9b69b8f60f8d73f14c848d files/lighttpd-1.3.13-pam-name.diff 564
 MD5 210f81ad7867965b19993d0a4d8d54e7 files/lighttpd.logrotate 488
-MD5 2473934daf9c34575a40c287a3d6f597 files/conf/lighttpd.conf 8243
-MD5 20f159c94154005138a3c709fd476beb files/conf/mod_fastcgi.conf 566
-MD5 cac2b9328b62830cb4601f83695b541e files/conf/mime-types.conf 2965
+MD5 9c1407e95f62ed22da66c4ef5f69c3b5 files/conf/mod_cgi.conf 869
+MD5 b1682262d6b8120b9a61a59159b062ba files/conf/lighttpd.conf 8180
+MD5 b4c80dba9c626d5f89d3c3797ac6670c files/conf/mod_fastcgi.conf 661
+MD5 fef397e7bcf1b741dea211a555e1803c files/conf/mime-types.conf 3291
+MD5 82eabd1cddfa4f03ba1a396479cdfc07 files/1.4.1/03_all_mod_cgi-wait.diff 461
+MD5 995d8cad62f698bf4ff409e0fddd1e75 files/1.4.1/08_all_doc-updates.diff 1452
+MD5 5bfb3d4ddc7454842865fd843e2625d8 files/1.4.1/02_all_optional_pcre.diff 563
+MD5 6d70755e9e587be97a1a9e20f45da194 files/1.4.1/04_all_mod_cgi-create-env-once.diff 294
+MD5 88fde1bcdf7ccf4eb7fe69cdf3d0fa82 files/1.4.1/06_all_check-for-waiting-write.diff 2205
+MD5 64cef80341b3cdc7a5298c3f4c75066a files/1.4.1/01_all_any-fam.diff 4080
+MD5 ef2a8ad3ae2d26b163bfa379da101e61 files/1.4.1/07_all_fix-dst_addr_buf-leak.diff 890
+MD5 beb94165c83f50b8d2eddd9e8cc7dbe9 files/1.4.1/09_all_lfs-range-requests.diff 970
+MD5 4dd7328c713617f5b637853edd7ebcfc files/1.4.1/05_all_fix_array_merging.diff 10158
+MD5 8a15bebfc64b014d60f78768c94d7839 files/1.4.1/10_all_stat_cache_init_after_setuid.diff 1400
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (GNU/Linux)
 
-iD8DBQFDCnphEZCkKN40op4RAs2UAJ9K7fzj88QSPKYXtNlaOZH2QNzYYACfZzU6
-j1PaZEj8/Z71sDEMFplvVnE=
-=weLK
+iD8DBQFDEF5+EZCkKN40op4RAt/uAJ0Y5sNIbe5a0CnA9STfGZppgpyTzgCgsPax
+Ippmx6h1HQzWHZQJPHlWCWY=
+=J00a
 -----END PGP SIGNATURE-----
diff --git a/www-servers/lighttpd/files/1.4.1/01_all_any-fam.diff b/www-servers/lighttpd/files/1.4.1/01_all_any-fam.diff
new file mode 100644 (file)
index 0000000..0eefc99
--- /dev/null
@@ -0,0 +1,170 @@
+--- branches/lighttpd-merge-1.4.x/configure.in (revision 621)
++++ branches/lighttpd-merge-1.4.x/configure.in (revision 622)
+@@ -260,16 +260,29 @@
+ fi
+ 
+ dnl Check for gamin
+-AC_MSG_CHECKING(for gamin)
+-AC_ARG_WITH(gamin, AC_HELP_STRING([--with-gamin],[gamin for reducing number of stat() calls]),
+-[WITH_GAMIN=$withval],[WITH_GAMIN=no])
+-AC_MSG_RESULT([$WITH_GAMIN])
+-
+-if test "$WITH_GAMIN" != "no"; then
+-   PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
++AC_MSG_CHECKING(for FAM)
++AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam],[fam/gamin for reducing number of stat() calls]),
++[WITH_FAM=$withval],[WITH_FAM=no])
++AC_MSG_RESULT([$WITH_FAM])
++
++if test "$WITH_FAM" != "no"; then
++  AC_CHECK_LIB(fam, FAMOpen2, [
++    AC_CHECK_HEADERS([fam.h],[
++      FAM_LIBS=-lfam
+       AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
+       AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
+-   ])
++    ])
++  ])
++  if test "x$FAM_LIBS" = x; then
++    PKG_CHECK_MODULES(FAM, gamin >= 0.1.0, [
++      AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
++      AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
++    ])
++  fi
++  OLD_LIBS=$LIBS
++  LIBS=$FAM_LIBS
++  AC_CHECK_FUNCS([FAMNoExists])
++  LIBS=$OLD_LIBS
+ fi
+ 
+ AC_MSG_CHECKING(for properties in mod_webdav)
+--- branches/lighttpd-merge-1.4.x/src/stat_cache.c     (revision 621)
++++ branches/lighttpd-merge-1.4.x/src/stat_cache.c     (revision 622)
+@@ -98,9 +98,10 @@
+       if (0 != FAMOpen2(fc->fam, "lighttpd")) {
+               return NULL;
+       }
+-
++#ifdef HAVE_FAMNOEXISTS
+       FAMNoExists(fc->fam);
+ #endif
++#endif
+ 
+       return fc;
+ }
+@@ -173,9 +174,11 @@
+ 
+ #ifdef HAVE_FAM_H
+       splaytree_delete_tree(fc->dirs, fam_dir_entry_free);
+-      
+-      FAMClose(fc->fam);
+-      free(fc->fam);
++
++      if (fc->fam) {
++              FAMClose(fc->fam);
++              free(fc->fam);
++      }
+ #endif
+       free(fc);
+ }
+@@ -217,46 +220,63 @@
+       UNUSED(revent);
+       /* */
+ 
+-      events = FAMPending(sc->fam);
++      if ((revent & FDEVENT_IN) &&
++          sc->fam) {
++
++              events = FAMPending(sc->fam);
+       
+-      for (i = 0; i < events; i++) {
+-              FAMEvent fe;
+-              fam_dir_entry *fam_dir;
+-              splay_tree *node;
+-              int ndx;
++              for (i = 0; i < events; i++) {
++                      FAMEvent fe;
++                      fam_dir_entry *fam_dir;
++                      splay_tree *node;
++                      int ndx;
+               
+-              FAMNextEvent(sc->fam, &fe);
++                      FAMNextEvent(sc->fam, &fe);
+       
+-              /* handle event */
++                      /* handle event */
+ 
+-              switch(fe.code) {
+-              case FAMChanged:
+-              case FAMDeleted:
+-              case FAMMoved:
+-                      /* if the filename is a directory remove the entry */
++                      switch(fe.code) {
++                      case FAMChanged:
++                      case FAMDeleted:
++                      case FAMMoved:
++                              /* if the filename is a directory remove the entry */
+ 
+-                      fam_dir = fe.userdata;
+-                      fam_dir->version++;
++                              fam_dir = fe.userdata;
++                              fam_dir->version++;
+ 
+-                      /* file/dir is still here */
+-                      if (fe.code == FAMChanged) break;
++                              /* file/dir is still here */
++                              if (fe.code == FAMChanged) break;
+ 
+-                      buffer_copy_string(sc->dir_name, fe.filename);
++                              buffer_copy_string(sc->dir_name, fe.filename);
+ 
+-                      ndx = hashme(sc->dir_name);
++                              ndx = hashme(sc->dir_name);
+ 
+-                      sc->dirs = splaytree_splay(sc->dirs, ndx);
+-                      node = sc->dirs;
++                              sc->dirs = splaytree_splay(sc->dirs, ndx);
++                              node = sc->dirs;
+                       
+-                      if (node && (node->key == ndx)) {
+-                              fam_dir_entry_free(node->data);
+-                              sc->dirs = splaytree_delete(sc->dirs, ndx);
++                              if (node && (node->key == ndx)) {
++                                      fam_dir_entry_free(node->data);
++                                      sc->dirs = splaytree_delete(sc->dirs, ndx);
++                              }
++                              break;
++                      default:
++                              break;
+                       }
+-                      break;
+-              default:
+-                      break;
+               }
+       }
++
++      if (revent & FDEVENT_HUP) {
++              /* fam closed the connection */
++              srv->stat_cache->fam_fcce_ndx = -1;
++
++              fdevent_event_del(srv->ev, &(sc->fam_fcce_ndx), FAMCONNECTION_GETFD(sc->fam));
++              fdevent_unregister(srv->ev, FAMCONNECTION_GETFD(sc->fam));
++
++              FAMClose(sc->fam);
++              free(sc->fam);
++
++              sc->fam = NULL;
++      }
+       
+       return HANDLER_GO_ON;
+ }
+@@ -397,7 +417,8 @@
+               }
+               
+ #ifdef HAVE_FAM_H
+-              if (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM) {
++              if (sc->fam &&
++                  (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM)) {
+                       /* is this directory already registered ? */
+                       if (!dir_node) {
+                               fam_dir = fam_dir_entry_init();
diff --git a/www-servers/lighttpd/files/1.4.1/02_all_optional_pcre.diff b/www-servers/lighttpd/files/1.4.1/02_all_optional_pcre.diff
new file mode 100644 (file)
index 0000000..ed56914
--- /dev/null
@@ -0,0 +1,16 @@
+--- configure.in.orig  2005-08-24 02:40:58.000000000 -0400
++++ configure.in       2005-08-24 02:51:01.000000000 -0400
+@@ -217,7 +217,12 @@
+     AC_SUBST(SSL_LIB)
+ fi
+ 
+-if test "x$cross_compiling" = xno; then
++AC_MSG_CHECKING(for perl regular expressions support)
++AC_ARG_WITH(pcre, AC_HELP_STRING([--with-pcre],[Enable pcre support (default yes)]),
++    [WITH_PCRE=$withval],[WITH_PCRE=yes])
++AC_MSG_RESULT([$WITH_PCRE])
++
++if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
+   AC_PATH_PROG(PCRECONFIG, pcre-config)
+ 
+   if test x"$PCRECONFIG" != x; then 
diff --git a/www-servers/lighttpd/files/1.4.1/03_all_mod_cgi-wait.diff b/www-servers/lighttpd/files/1.4.1/03_all_mod_cgi-wait.diff
new file mode 100644 (file)
index 0000000..128acab
--- /dev/null
@@ -0,0 +1,16 @@
+--- branches/lighttpd-merge-1.4.x/src/mod_cgi.c        (revision 612)
++++ branches/lighttpd-merge-1.4.x/src/mod_cgi.c        (revision 613)
+@@ -1127,12 +1127,7 @@
+ #ifndef __WIN32       
+       switch(waitpid(hctx->pid, &status, WNOHANG)) {
+       case 0:
+-              /* not finished yet */
+-              if (con->file_started) {
+-                      return HANDLER_GO_ON;
+-              } else {
+-                      return HANDLER_WAIT_FOR_EVENT;
+-              }
++              return HANDLER_WAIT_FOR_EVENT;
+       case -1:
+               if (errno == EINTR) return HANDLER_WAIT_FOR_EVENT;
+               
diff --git a/www-servers/lighttpd/files/1.4.1/04_all_mod_cgi-create-env-once.diff b/www-servers/lighttpd/files/1.4.1/04_all_mod_cgi-create-env-once.diff
new file mode 100644 (file)
index 0000000..b44230f
--- /dev/null
@@ -0,0 +1,11 @@
+--- branches/lighttpd-merge-1.4.x/src/mod_cgi.c        (revision 618)
++++ branches/lighttpd-merge-1.4.x/src/mod_cgi.c        (revision 619)
+@@ -1064,6 +1064,8 @@
+                               buffer_reset(con->physical.path);
+                               return HANDLER_FINISHED;
+                       }
++                      /* one handler is enough for the request */
++                      break;
+               }
+       }
+       
diff --git a/www-servers/lighttpd/files/1.4.1/05_all_fix_array_merging.diff b/www-servers/lighttpd/files/1.4.1/05_all_fix_array_merging.diff
new file mode 100644 (file)
index 0000000..668c934
--- /dev/null
@@ -0,0 +1,327 @@
+--- branches/lighttpd-merge-1.4.x/src/configfile-glue.c        (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/configfile-glue.c        (revision 616)
+@@ -42,7 +42,7 @@
+                                               data_string *ds = data_string_init();
+                                               
+                                               buffer_copy_string_buffer(ds->value, ((data_string *)(da->value->data[j]))->value);
+-                                              if (!da->value->is_array) {
++                                              if (!da->is_index_key) {
+                                                       /* the id's were generated automaticly, as we copy now we might have to renumber them
+                                                        * this is used to prepend server.modules by mod_indexfiles as it has to be loaded 
+                                                        * before mod_fastcgi and friends */
+--- branches/lighttpd-merge-1.4.x/src/configparser.y   (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/configparser.y   (revision 616)
+@@ -70,7 +70,7 @@
+ /* op1 is to be eat/return by this function, op1->key is not cared
+    op2 is left untouch, unreferenced
+  */
+-data_unset *configparser_merge_data(config_t *ctx, data_unset *op1, const data_unset *op2) {
++data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
+   /* type mismatch */
+   if (op1->type != op2->type) {
+     if (op1->type == TYPE_STRING && op2->type == TYPE_INTEGER) {
+@@ -85,7 +85,6 @@
+       return (data_unset *)ds;
+     } else {
+       fprintf(stderr, "data type mismatch, cannot be merge\n");
+-      ctx->ok = 0;
+       op1->free(op1);
+       return NULL;
+     }
+@@ -179,13 +178,23 @@
+ 
+   if (NULL != (du = array_get_element(vars, A->ptr))) {
+     /* exists in current block */
+-    du = configparser_merge_data(ctx, du, B);
+-    buffer_copy_string_buffer(du->key, A);
+-    array_replace(vars, du);
++    du = configparser_merge_data(du, B);
++    if (NULL == du) {
++      ctx->ok = 0;
++    }
++    else {
++      buffer_copy_string_buffer(du->key, A);
++      array_replace(vars, du);
++    }
+   } else if (NULL != (du = configparser_get_variable(ctx, A))) {
+-    du = configparser_merge_data(ctx, du, B);
+-    buffer_copy_string_buffer(du->key, A);
+-    array_insert_unique(ctx->current->value, du);
++    du = configparser_merge_data(du, B);
++    if (NULL == du) {
++      ctx->ok = 0;
++    }
++    else {
++      buffer_copy_string_buffer(du->key, A);
++      array_insert_unique(ctx->current->value, du);
++    }
+   } else {
+     fprintf(stderr, "Undefined config variable in conditional 1 %s: %s\n", 
+             ctx->current->key->ptr, A->ptr);
+@@ -210,7 +219,10 @@
+ }
+ 
+ expression(A) ::= expression(B) PLUS value(C). {
+-  A = configparser_merge_data(ctx, B, C);
++  A = configparser_merge_data(B, C);
++  if (NULL == A) {
++    ctx->ok = 0;
++  }
+   B = NULL;
+   C->free(C);
+   C = NULL;
+--- branches/lighttpd-merge-1.4.x/src/array.c  (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/array.c  (revision 616)
+@@ -28,7 +28,6 @@
+       a->size = src->size;
+       a->next_power_of_2 = src->next_power_of_2;
+       a->unique_ndx = src->unique_ndx;
+-      a->is_array = src->is_array;
+ 
+       a->data = malloc(sizeof(*src->data) * src->size);
+       for (i = 0; i < src->size; i++) {
+@@ -167,9 +166,9 @@
+       size_t j;
+       
+       /* generate unique index if neccesary */
+-      if (str->key->used == 0) {
++      if (str->key->used == 0 || str->is_index_key) {
+               buffer_copy_long(str->key, a->unique_ndx++);
+-              a->is_array = 1;
++              str->is_index_key = 1;
+       }
+       
+       /* try to find the string */
+@@ -251,12 +250,6 @@
+       return maxlen;
+ }
+ 
+-static inline int str_int_equal(const char *str, int i) {
+-      char buf[16];
+-      snprintf(buf, sizeof(buf), "%d", i);
+-      return strcmp(str, buf) == 0;
+-}
+-
+ int array_print(array *a, int depth) {
+       size_t i;
+       size_t maxlen;
+@@ -267,7 +260,7 @@
+       }
+       for (i = 0; i < a->used && oneline; i++) {
+               data_unset *du = a->data[i];
+-              if (!str_int_equal(du->key->ptr, i)) {
++              if (!du->is_index_key) {
+                       oneline = 0;
+                       break;
+               }
+@@ -299,7 +292,7 @@
+       for (i = 0; i < a->used; i++) {
+               data_unset *du = a->data[i];
+               array_print_indent(depth + 1);
+-              if (!str_int_equal(du->key->ptr, i)) {
++              if (!du->is_index_key) {
+                       int j;
+ 
+                       if (i && (i % 5) == 0) {
+--- branches/lighttpd-merge-1.4.x/src/array.h  (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/array.h  (revision 616)
+@@ -14,6 +14,7 @@
+ #define DATA_UNSET \
+       data_type_t type; \
+       buffer *key; \
++      int is_index_key; /* 1 if key is a array index (autogenerated keys) */ \
+       struct data_unset *(*copy)(const struct data_unset *src); \
+       void (* free)(struct data_unset *p); \
+       void (* reset)(struct data_unset *p); \
+@@ -33,7 +34,6 @@
+       size_t size;
+       
+       size_t unique_ndx;
+-      int is_array; /* 0 if it is a hash, 1 for array (autogenerated keys) */
+       
+       size_t next_power_of_2;
+       int is_weakref; /* data is weakref, don't bother the data */
+--- branches/lighttpd-merge-1.4.x/src/data_integer.c   (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/data_integer.c   (revision 616)
+@@ -9,6 +9,7 @@
+       data_integer *ds = data_integer_init();
+ 
+       buffer_copy_string_buffer(ds->key, src->key);
++      ds->is_index_key = src->is_index_key;
+       ds->value = src->value;
+       return (data_unset *)ds;
+ }
+--- branches/lighttpd-merge-1.4.x/src/mod_staticfile.c (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/mod_staticfile.c (revision 616)
+@@ -2,6 +2,8 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#define _XOPEN_SOURCE /* glibc 2.0 */
++#define __USE_XOPEN /* glibc 2.3 */
+ #include <time.h>
+ 
+ #include "base.h"
+--- branches/lighttpd-merge-1.4.x/src/configfile.c     (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/configfile.c     (revision 616)
+@@ -26,7 +26,6 @@
+       size_t i;
+       int ret = 0;
+       buffer *stat_cache_string;
+-      data_string *ds;
+       
+       config_values_t cv[] = { 
+               { "server.bind",                 NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER },      /* 0 */
+@@ -117,13 +116,6 @@
+ 
+       assert(srv->config_storage);
+       
+-      /* prepend default modules */
+-      if (NULL == array_get_element(srv->srvconf.modules, "mod_indexfile")) {
+-              ds = data_string_init();
+-              buffer_copy_string(ds->value, "mod_indexfile");
+-              array_insert_unique(srv->srvconf.modules, (data_unset *)ds);
+-      }
+-      
+       for (i = 0; i < srv->config_context->used; i++) {
+               specific_config *s;
+               
+@@ -211,21 +203,6 @@
+       
+       buffer_free(stat_cache_string);
+       
+-      srv->srvconf.modules->unique_ndx = srv->srvconf.modules->used;
+-      
+-      /* append default modules */
+-      if (NULL == array_get_element(srv->srvconf.modules, "mod_dirlisting")) {
+-              ds = data_string_init();
+-              buffer_copy_string(ds->value, "mod_dirlisting");
+-              array_insert_unique(srv->srvconf.modules, (data_unset *)ds);
+-      }
+-      
+-      if (NULL == array_get_element(srv->srvconf.modules, "mod_staticfile")) {
+-              ds = data_string_init();
+-              buffer_copy_string(ds->value, "mod_staticfile");
+-              array_insert_unique(srv->srvconf.modules, (data_unset *)ds);
+-      }
+-      
+       return ret;
+                                                                
+ }
+@@ -923,6 +900,7 @@
+       data_config *dc;
+       int ret;
+       char *pos;
++      data_array *modules;
+ 
+       context_init(srv, &context);
+       context.all_configs = srv->config_context;
+@@ -960,16 +938,55 @@
+               return ret;
+       }
+ 
+-      if (0 != config_insert(srv)) {
+-              return -1;
+-      }
+-      
+       if (NULL != (dc = (data_config *)array_get_element(srv->config_context, "global"))) {
+               srv->config = dc->value;
+       } else {
+               return -1;
+       }
+       
++      if (NULL != (modules = (data_array *)array_get_element(srv->config, "server.modules"))) {
++              data_string *ds;
++              data_array *prepends;
++
++              if (modules->type != TYPE_ARRAY) {
++                      fprintf(stderr, "server.modules must be an array");
++                      return -1;
++              }
++
++              prepends = data_array_init();
++
++              /* prepend default modules */
++              if (NULL == array_get_element(modules->value, "mod_indexfile")) {
++                      ds = data_string_init();
++                      buffer_copy_string(ds->value, "mod_indexfile");
++                      array_insert_unique(prepends->value, (data_unset *)ds);
++              }
++
++              prepends = (data_array *)configparser_merge_data((data_unset *)prepends, (data_unset *)modules);
++              buffer_copy_string_buffer(prepends->key, modules->key);
++              array_replace(srv->config, (data_unset *)prepends);
++              modules->free((data_unset *)modules);
++              modules = prepends;
++
++              /* append default modules */
++              if (NULL == array_get_element(modules->value, "mod_dirlisting")) {
++                      ds = data_string_init();
++                      buffer_copy_string(ds->value, "mod_dirlisting");
++                      array_insert_unique(modules->value, (data_unset *)ds);
++              }
++
++              if (NULL == array_get_element(modules->value, "mod_staticfile")) {
++                      ds = data_string_init();
++                      buffer_copy_string(ds->value, "mod_staticfile");
++                      array_insert_unique(modules->value, (data_unset *)ds);
++              }
++      }
++      
++
++      if (0 != config_insert(srv)) {
++              return -1;
++      }
++      
+       return 0;
+ }
+ 
+--- branches/lighttpd-merge-1.4.x/src/configfile.h     (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/configfile.h     (revision 616)
+@@ -19,5 +19,6 @@
+ void configparser(void *yyp, int yymajor, buffer *yyminor, config_t *ctx);
+ int config_parse_file(server *srv, config_t *context, const char *fn);
+ int config_parse_cmd(server *srv, config_t *context, const char *cmd);
++data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2);
+ 
+ #endif
+--- branches/lighttpd-merge-1.4.x/src/data_count.c     (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/data_count.c     (revision 616)
+@@ -10,6 +10,7 @@
+ 
+       buffer_copy_string_buffer(ds->key, src->key);
+       ds->count = src->count;
++      ds->is_index_key = src->is_index_key;
+       return (data_unset *)ds;
+ }
+ 
+--- branches/lighttpd-merge-1.4.x/src/data_string.c    (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/data_string.c    (revision 616)
+@@ -11,6 +11,7 @@
+ 
+       buffer_copy_string_buffer(ds->key, src->key);
+       buffer_copy_string_buffer(ds->value, src->value);
++      ds->is_index_key = src->is_index_key;
+       return (data_unset *)ds;
+ }
+ 
+--- branches/lighttpd-merge-1.4.x/src/data_fastcgi.c   (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/data_fastcgi.c   (revision 616)
+@@ -11,6 +11,7 @@
+ 
+       buffer_copy_string_buffer(ds->key, src->key);
+       buffer_copy_string_buffer(ds->host, src->host);
++      ds->is_index_key = src->is_index_key;
+       return (data_unset *)ds;
+ }
+ 
+--- branches/lighttpd-merge-1.4.x/src/data_array.c     (revision 615)
++++ branches/lighttpd-merge-1.4.x/src/data_array.c     (revision 616)
+@@ -11,6 +11,7 @@
+       buffer_copy_string_buffer(ds->key, src->key);
+       array_free(ds->value);
+       ds->value = array_init_array(src->value);
++      ds->is_index_key = src->is_index_key;
+       return (data_unset *)ds;
+ }
+ 
diff --git a/www-servers/lighttpd/files/1.4.1/06_all_check-for-waiting-write.diff b/www-servers/lighttpd/files/1.4.1/06_all_check-for-waiting-write.diff
new file mode 100644 (file)
index 0000000..6bd187a
--- /dev/null
@@ -0,0 +1,67 @@
+--- branches/lighttpd-merge-1.4.x/src/connections.c    (revision 620)
++++ branches/lighttpd-merge-1.4.x/src/connections.c    (revision 621)
+@@ -213,7 +213,7 @@
+               
+ #ifdef USE_OPENSSL
+               if (srv_sock->is_ssl) {
+-                      int r;
++                      int r, ssl_err;
+                       
+                       switch ((r = SSL_get_error(con->ssl, len))) {
+                       case SSL_ERROR_WANT_READ:
+@@ -237,8 +237,15 @@
+                               
+                               /* fall thourgh */
+                       default:
+-                              log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:", 
+-                                              r, ERR_error_string(ERR_get_error(), NULL));
++                              ssl_err = ERR_get_error();
++                              switch(ssl_err) {
++                              case SSL_F_SSL23_GET_CLIENT_HELLO:
++                                      /* a unencrypted HTTP request on a HTTPS socket. Do a redirect to the right location */
++                              default:
++                                      log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:", 
++                                                      r, ERR_error_string(ERR_get_error(), NULL));
++                                      break;
++                              }
+                               break;
+                       }
+               } else {
+--- branches/lighttpd-merge-1.4.x/src/mod_compress.c   (revision 620)
++++ branches/lighttpd-merge-1.4.x/src/mod_compress.c   (revision 621)
+@@ -357,7 +357,7 @@
+                       
+                       if (-1 == mkdir(p->b->ptr, 0700)) {
+                               if (errno != EEXIST) {
+-                                      log_error_write(srv, __FILE__, __LINE__, "ssss", "creating cache-directory", p->b->ptr, "failed", strerror(errno));
++                                      log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cache-directory", p->b, "failed", strerror(errno));
+                                       
+                                       return -1;
+                               }
+--- branches/lighttpd-merge-1.4.x/src/network_openssl.c        (revision 620)
++++ branches/lighttpd-merge-1.4.x/src/network_openssl.c        (revision 621)
+@@ -123,6 +123,7 @@
+                       size_t toSend;
+                       stat_cache_entry *sce = NULL;
+                       int ifd;
++                      int write_wait = 0;
+                       
+                       if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->data.file.name, &sce)) {
+                               log_error_write(srv, __FILE__, __LINE__, "sb",
+@@ -162,6 +163,7 @@
+                               if ((r = SSL_write(con->ssl, s, toSend)) <= 0) {
+                                       switch ((ssl_r = SSL_get_error(con->ssl, r))) {
+                                       case SSL_ERROR_WANT_WRITE:
++                                              write_wait = 1;
+                                               break;
+                                       case SSL_ERROR_SYSCALL:
+                                               switch(errno) {
+@@ -196,7 +198,7 @@
+                               if (c->offset == c->data.file.length) {
+                                       chunk_finished = 1;
+                               }
+-                      } while(!chunk_finished);
++                      } while(!chunk_finished && !write_wait);
+                       
+                       break;
+               }
diff --git a/www-servers/lighttpd/files/1.4.1/07_all_fix-dst_addr_buf-leak.diff b/www-servers/lighttpd/files/1.4.1/07_all_fix-dst_addr_buf-leak.diff
new file mode 100644 (file)
index 0000000..7559e88
--- /dev/null
@@ -0,0 +1,34 @@
+--- branches/lighttpd-merge-1.4.x/src/connections.c    (revision 623)
++++ branches/lighttpd-merge-1.4.x/src/connections.c    (revision 624)
+@@ -554,6 +554,7 @@
+       CLEAN(authed_user);
+       CLEAN(server_name);
+       CLEAN(error_handler);
++      CLEAN(dst_addr_buf);
+       
+ #undef CLEAN
+       con->write_queue = chunkqueue_init();
+@@ -567,7 +568,6 @@
+       con->plugin_ctx = calloc(srv->plugins.used + 1, sizeof(void *));
+       
+       con->cond_cache = calloc(srv->config_context->used, sizeof(cond_cache_t));
+-      con->dst_addr_buf = buffer_init();
+       config_setup_connection(srv, con);
+       
+       return con;
+@@ -615,6 +615,7 @@
+               CLEAN(authed_user);
+               CLEAN(server_name);
+               CLEAN(error_handler);
++              CLEAN(dst_addr_buf);
+ #undef CLEAN
+               free(con->plugin_ctx);
+               free(con->cond_cache);
+@@ -686,6 +687,7 @@
+       CLEAN(authed_user);
+       CLEAN(server_name);
+       CLEAN(error_handler);
++      CLEAN(dst_addr_buf);
+ #undef CLEAN  
+       
+ #define CLEAN(x) \
diff --git a/www-servers/lighttpd/files/1.4.1/08_all_doc-updates.diff b/www-servers/lighttpd/files/1.4.1/08_all_doc-updates.diff
new file mode 100644 (file)
index 0000000..f8450b6
--- /dev/null
@@ -0,0 +1,32 @@
+--- branches/lighttpd-merge-1.4.x/doc/redirect.txt     (revision 619)
++++ branches/lighttpd-merge-1.4.x/doc/redirect.txt     (revision 620)
+@@ -34,3 +34,6 @@
+     url.redirect = ( "^/show/([0-9]+)/([0-9]+)$" => "http://www.example.org/show.php?isdn=$1&page$2",
+                      "^/get/([0-9]+)/([0-9]+)$"  => "http://www.example.org/get.php?isdn=$1&page$2" )
+ 
++    $HTTP["host"] =~ "^www\.(.*)" {
++      url.redirect = ( "^/(.*)" => "http://%1/$1" )
++    }
+--- branches/lighttpd-merge-1.4.x/doc/rewrite.txt      (revision 619)
++++ branches/lighttpd-merge-1.4.x/doc/rewrite.txt      (revision 620)
+@@ -51,3 +51,7 @@
+ 
+   url.rewrite-once = ( "^/id/([0-9]+)$" => "/index.php?id=$1",
+                        "^/link/([a-zA-Z]+)" => "/index.php?link=$1" )
++
++  $HTTP["host"] =~ "^([^.]+)\.(this-is-mass-vhost\.com)" {
++    url.rewrite-once = ( "^/(.*)" => "/%2/%1/$1" )
++  }
+--- branches/lighttpd-merge-1.4.x/doc/lighttpd.conf    (revision 619)
++++ branches/lighttpd-merge-1.4.x/doc/lighttpd.conf    (revision 620)
+@@ -254,6 +254,10 @@
+ #### url handling modules (rewrite, redirect, access)
+ #url.rewrite                = ( "^/$"             => "/server-status" )
+ #url.redirect               = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
++#### both rewrite/redirect support back reference to regex conditional using %n
++#$HTTP["host"] =~ "^www\.(.*)" {
++#  url.redirect            = ( "^/(.*)" => "http://%1/$1" )
++#}
+ 
+ #
+ # define a pattern for the host url finding
diff --git a/www-servers/lighttpd/files/1.4.1/09_all_lfs-range-requests.diff b/www-servers/lighttpd/files/1.4.1/09_all_lfs-range-requests.diff
new file mode 100644 (file)
index 0000000..070bf67
--- /dev/null
@@ -0,0 +1,39 @@
+--- branches/lighttpd-merge-1.4.x/src/mod_staticfile.c (revision 624)
++++ branches/lighttpd-merge-1.4.x/src/mod_staticfile.c (revision 625)
+@@ -166,12 +166,12 @@
+       for (s = con->request.http_range, error = 0;
+            !error && *s && NULL != (minus = strchr(s, '-')); ) {
+               char *err;
+-              long la, le;
++              off_t la, le;
+               
+               if (s == minus) {
+                       /* -<stop> */
+                       
+-                      le = strtol(s, &err, 10);
++                      le = strtoll(s, &err, 10);
+                       
+                       if (le == 0) {
+                               /* RFC 2616 - 14.35.1 */
+@@ -197,7 +197,7 @@
+               } else if (*(minus+1) == '\0' || *(minus+1) == ',') {
+                       /* <start>- */
+                       
+-                      la = strtol(s, &err, 10);
++                      la = strtoll(s, &err, 10);
+                       
+                       if (err == minus) {
+                               /* ok */
+@@ -224,10 +224,10 @@
+               } else {
+                       /* <start>-<stop> */
+                       
+-                      la = strtol(s, &err, 10);
++                      la = strtoll(s, &err, 10);
+                       
+                       if (err == minus) {
+-                              le = strtol(minus+1, &err, 10);
++                              le = strtoll(minus+1, &err, 10);
+                               
+                               /* RFC 2616 - 14.35.1 */
+                               if (la > le) {
diff --git a/www-servers/lighttpd/files/1.4.1/10_all_stat_cache_init_after_setuid.diff b/www-servers/lighttpd/files/1.4.1/10_all_stat_cache_init_after_setuid.diff
new file mode 100644 (file)
index 0000000..222e367
--- /dev/null
@@ -0,0 +1,53 @@
+Index: src/server.c
+===================================================================
+--- src/server.c       (revision 625)
++++ src/server.c       (working copy)
+@@ -160,9 +160,6 @@
+       srv->fdwaitqueue = calloc(1, sizeof(*srv->fdwaitqueue));
+       assert(srv->fdwaitqueue);
+       
+-      srv->stat_cache = stat_cache_init();
+-      assert(srv->stat_cache);
+-      
+       srv->srvconf.modules = array_init();
+       
+       /* use syslog */
+@@ -243,8 +240,10 @@
+       joblist_free(srv, srv->joblist);
+       fdwaitqueue_free(srv, srv->fdwaitqueue);
+       
+-      stat_cache_free(srv->stat_cache);
+-      
++      if (srv->stat_cache) {
++              stat_cache_free(srv->stat_cache);
++      }
++
+       array_free(srv->srvconf.modules);
+       array_free(srv->split_vals);
+       
+@@ -720,13 +719,24 @@
+       
+       /* setup periodic timer (1 second) */
+       if (setitimer(ITIMER_REAL, &interval, NULL)) {
+-              log_error_write(srv, __FILE__, __LINE__, "setting timer failed");
++              log_error_write(srv, __FILE__, __LINE__, "s", "setting timer failed");
+               return -1;
+       }
+       
+       getitimer(ITIMER_REAL, &interval);
+ #endif
+ 
++      /* might fail if user is using fam (not gamin) and famd isn't running */
++      if (NULL == (srv->stat_cache = stat_cache_init())) {
++#if defined(HAVE_FAM_H) && !defined(HAVE_FAMNOEXISTS)
++              log_error_write(srv, __FILE__, __LINE__, "s",
++                      "FAMOpen2() failed.  Is famd running?");
++              return -1;
++#else
++              SEGFAULT();
++#endif
++      }
++
+ #ifdef HAVE_FAM_H
+       /* setup FAM */
+       srv->stat_cache->fam_fcce_ndx = -1;
index 576e870228ad3ddc564cee8c5cd6cfd95416b3dd..af14bf1fe3fb316036b312fea15f68c924ab5063 100644 (file)
@@ -1,15 +1,18 @@
 ###############################################################################
 # Default lighttpd.conf for Gentoo.
-# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/lighttpd.conf,v 1.1 2005/08/22 16:01:18 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/lighttpd.conf,v 1.2 2005/08/27 12:36:13 ka0ttic Exp $
 ###############################################################################
 
-include "mime-types.conf"
-# uncomment for php/fastcgi support
-# include "mod_fastcgi.conf"
+# {{{ variables
+var.basedir  = "/var/www/localhost"
+var.logdir   = "/var/log/lighttpd"
+var.statedir = "/var/lib/lighttpd"
+# }}}
 
 # {{{ modules
 # At the very least, mod_access and mod_accesslog should be enabled.
 # All other modules should only be loaded if necessary.
+# NOTE: the order of modules is important.
 server.modules = (
 #    "mod_rewrite",
 #    "mod_redirect",
@@ -24,7 +27,6 @@ server.modules = (
 #    "mod_simple_vhost",
 #    "mod_evhost",
 #    "mod_userdir",
-#    "mod_cgi",
 #    "mod_compress",
 #    "mod_ssi",
 #    "mod_usertrack",
@@ -32,17 +34,29 @@ server.modules = (
 #    "mod_secdownload",
 #    "mod_rrdtool",
 #    "mod_webdav",
-    "mod_accesslog" )
+    "mod_accesslog"
+)
+# }}}
+
+# {{{ includes
+include "mime-types.conf"
+# uncomment for cgi support
+#   include "mod_cgi.conf"
+# uncomment for php/fastcgi support
+#   include "mod_fastcgi.conf"
 # }}}
 
 # {{{ server settings
 server.username      = "lighttpd"
 server.groupname     = "lighttpd"
 
-server.document-root = "/var/www/localhost/htdocs"
-server.errorlog      = "/var/log/lighttpd/error.log"
+server.document-root = var.basedir + "/htdocs"
 server.pid-file      = "/var/run/lighttpd.pid"
 
+server.errorlog      = var.logdir  + "/error.log"
+# log errors to syslog instead
+#   server.errorlog-use-syslog = "enable"
+
 server.indexfiles    = ("index.php", "index.html",
                                                "index.htm", "default.htm")
 
@@ -75,15 +89,14 @@ server.follow-symlink = "enable"
 
 # Format: <errorfile-prefix><status-code>.html
 # -> ..../status-404.html for 'File not found'
-# server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-"
+# server.errorfile-prefix    = var.basedir + "/error/status-"
 
 # FAM support for caching stat() calls
 # requires that lighttpd be built with USE=fam
 #   server.stat-cache-engine = "fam"
-
 # }}}
 
-# {{{ misc
+# {{{ mod_staticfile
 
 # which extensions should not be handled via static-file transfer
 # (extensions that are usually handled by mod_cgi, mod_fastcgi, etc).
@@ -91,7 +104,7 @@ static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi")
 # }}}
 
 # {{{ mod_accesslog
-accesslog.filename   = "/var/log/lighttpd/access.log"
+accesslog.filename   = var.logdir + "/access.log"
 # }}}
 
 # {{{ mod_dirlisting
@@ -116,14 +129,6 @@ accesslog.filename   = "/var/log/lighttpd/access.log"
 url.access-deny = ("~", ".inc")
 # }}}
 
-# {{{ mod_alias
-# see alias.txt
-#
-# alias.url = (
-#     "/cgi-bin/"          =>      "/var/www/localhost/cgi-bin/"
-# )
-# }}}
-
 # {{{ mod_userdir
 # see userdir.txt
 #
@@ -131,15 +136,6 @@ url.access-deny = ("~", ".inc")
 # userdir.exclude-user = ("root")
 # }}}
 
-# {{{ mod_cgi
-# see cgi.txt
-#
-# cgi.assign = (
-#     ".pl"    =>      "/usr/bin/perl",
-#     ".cgi"   =>      "/usr/bin/perl"
-# )
-# }}}
-
 # {{{ mod_ssi
 # see ssi.txt
 #
@@ -179,7 +175,7 @@ url.access-deny = ("~", ".inc")
 # {{{ mod_compress
 # see compress.txt
 #
-# compress.cache-dir   = "/var/lib/lighttpd/cache/compress"
+# compress.cache-dir   = var.statedir + "/cache/compress"
 # compress.filetype    = ("text/plain", "text/html")
 # }}}
 
@@ -261,7 +257,7 @@ url.access-deny = ("~", ".inc")
 # see rrdtool.txt
 #
 # rrdtool.binary  = "/usr/bin/rrdtool"
-# rrdtool.db-name = "/var/www/lighttpd.rrd"
+# rrdtool.db-name = var.statedir + "/lighttpd.rrd"
 # }}}
 
 # {{{ mod_setenv
@@ -301,11 +297,6 @@ url.access-deny = ("~", ".inc")
 
 # {{{ extra rules
 #
-# disable directory listings for /cgi-bin
-# $HTTP["url"] =~ "/cgi-bin/" {
-#     dir-listing.activate = "disable"
-# }
-
 # set Content-Encoding and reset Content-Type for browsers that
 # support decompressing on-thy-fly (requires mod_setenv)
 # $HTTP["url"] =~ "\.gz$" {
index c25670501f999e330823e18031bcf255c4979b62..3c3657773952b3b160665aff3432d2501782be91 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 # Default mime-types.conf for Gentoo.
 # include'd from lighttpd.conf.
-# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mime-types.conf,v 1.1 2005/08/22 16:01:18 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mime-types.conf,v 1.2 2005/08/27 12:36:13 ka0ttic Exp $
 ###############################################################################
 
 # {{{ mime types
@@ -45,10 +45,18 @@ mimetype.assign             = (
   ".hh"           =>      "text/plain",
   ".hpp"          =>      "text/plain",
   ".conf"         =>      "text/plain",
+  ".log"          =>      "text/plain",
   ".text"         =>      "text/plain",
   ".txt"          =>      "text/plain",
   ".diff"         =>      "text/plain",
   ".patch"        =>      "text/plain",
+  ".ebuild"       =>      "text/plain",
+  ".eclass"       =>      "text/plain",
+  ".rtf"          =>      "application/rtf",
+  ".bmp"          =>      "image/bmp",
+  ".tif"          =>      "image/tiff",
+  ".tiff"         =>      "image/tiff",
+  ".ico"          =>      "image/x-icon",
   ".dtd"          =>      "text/xml",
   ".xml"          =>      "text/xml",
   ".mpeg"         =>      "video/mpeg",
diff --git a/www-servers/lighttpd/files/conf/mod_cgi.conf b/www-servers/lighttpd/files/conf/mod_cgi.conf
new file mode 100644 (file)
index 0000000..1cb3770
--- /dev/null
@@ -0,0 +1,33 @@
+###############################################################################
+# mod_cgi.conf
+# include'd by lighttpd.conf.
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mod_cgi.conf,v 1.1 2005/08/27 12:36:13 ka0ttic Exp $
+###############################################################################
+
+#
+# see cgi.txt for more information on using mod_cgi
+#
+
+server.modules += ("mod_cgi")
+
+# NOTE: this requires mod_alias
+alias.url = (
+     "/cgi-bin/"           =>      var.basedir + "/cgi-bin/"
+)
+
+#
+# Note that you'll also want to enable the
+# cgi-bin alias via mod_alias (above).
+#
+
+$HTTP["url"] =~ "^/cgi-bin/" {
+    # disable directory listings
+    dir-listing.activate = "disable"
+    # only allow cgi's in this directory
+    cgi.assign = (
+               ".pl"   =>      "/usr/bin/perl",
+               ".cgi"  =>      "/usr/bin/perl"
+       )
+}
+
+# vim: set ft=conf foldmethod=marker et :
index 0da57b518440ecc306c23be33c1a51972f7c31ce..452e1749e1f7b622721fc558179f60bc59f9ed22 100644 (file)
@@ -1,19 +1,18 @@
 ###############################################################################
 # mod_fastcgi.conf
 # include'd by lighttpd.conf.
-# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mod_fastcgi.conf,v 1.1 2005/08/22 16:01:18 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mod_fastcgi.conf,v 1.2 2005/08/27 12:36:13 ka0ttic Exp $
 ###############################################################################
 
 server.modules += ("mod_fastcgi")
-fastcgi.server =
-       ( ".php" =>
-               ( "localhost" =>
-                       (
-                               "host"          =>              "127.0.0.1",
-                               "port"          =>              1026,
-                               "bin-path"      =>              "/usr/bin/php-cgi"
-                       )
-               )
-       )
+fastcgi.server = ( ".php" =>
+                           ( "localhost" =>
+                                   (
+                                           "host"              =>              "127.0.0.1",
+                                           "port"              =>              1026,
+                                           "bin-path"  =>              "/usr/bin/php-cgi"
+                                   )
+                           )
+                   )
 
 # vim: set ft=conf foldmethod=marker et :
similarity index 62%
rename from www-servers/lighttpd/lighttpd-1.4.1.ebuild
rename to www-servers/lighttpd/lighttpd-1.4.1-r1.ebuild
index 584dbc1750218bea93024b6f991e84b167787c29..7344121321b82d26268291c91168f36791d1d390 100644 (file)
@@ -1,13 +1,9 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.1.ebuild,v 1.2 2005/08/23 01:21:48 ka0ttic Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.1-r1.ebuild,v 1.1 2005/08/27 12:36:13 ka0ttic Exp $
 
-inherit eutils toolchain-funcs
+inherit eutils
 
-# bug #97661 - tests try to load modules from /usr/lib/lighttpd.
-# Needless to say, this will fail because either
-#   a) they don't exist since this is a first install, or
-#   b) they do exist, but they are from the previously installed version
 RESTRICT="test"
 
 DESCRIPTION="Lightweight high-performance web server"
@@ -17,29 +13,33 @@ SRC_URI="http://www.lighttpd.net/download/${P}.tar.gz"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~mips ~ppc ~x86"
-IUSE="doc fam gdbm ipv6 ldap lua mysql php ssl webdav xattr"
+IUSE="doc fam gdbm ipv6 ldap lua mysql pcre php ssl test webdav xattr"
 
 RDEPEND="app-arch/bzip2
-               >=sys-libs/zlib-1.1
-               >=dev-libs/libpcre-3.1
-               fam?      ( app-admin/gamin )
-               gdbm?     ( sys-libs/gdbm )
-               ldap?     ( >=net-nds/openldap-2.1.26 )
-               lua?      ( dev-lang/lua )
-               mysql?    ( >=dev-db/mysql-4.0.0 )
-               php?      (
-                       >=dev-php/php-cgi-4.3.0
-                       !net-www/spawn-fcgi
-               )
-               ssl?    ( >=dev-libs/openssl-0.9.7 )
-               webdav? (
-                       dev-libs/libxml2
-                       >=dev-db/sqlite-3
-               )
-               xattr?  ( sys-apps/attr )"
+       >=sys-libs/zlib-1.1
+       fam?      ( virtual/fam )
+       gdbm?     ( sys-libs/gdbm )
+       ldap?     ( >=net-nds/openldap-2.1.26 )
+       lua?      ( dev-lang/lua )
+       mysql?    ( >=dev-db/mysql-4.0.0 )
+       pcre?     ( >=dev-libs/libpcre-3.1 )
+       php?      (
+               >=dev-php/php-cgi-4.3.0
+               !net-www/spawn-fcgi
+       )
+       ssl?    ( >=dev-libs/openssl-0.9.7 )
+       webdav? (
+               dev-libs/libxml2
+               >=dev-db/sqlite-3
+       )
+       xattr?  ( sys-apps/attr )"
 
 DEPEND="${RDEPEND}
-       doc? ( dev-python/docutils )"
+       doc?  ( dev-python/docutils )
+       test? (
+               perl-core/Test-Harness
+               dev-libs/fcgi
+       )"
 
 # update certain parts of lighttpd.conf based on conditionals
 update_config() {
@@ -54,33 +54,47 @@ update_config() {
                dosed 's|#\(.*stat-cache.*$\)|\1|' ${config}
 }
 
+pkg_setup() {
+       if ! use pcre ; then
+               ewarn "It is highly recommended that you build ${PN}"
+               ewarn "with perl regular expressions support via USE=pcre."
+               ewarn "Otherwise you lose support for some core options and"
+               ewarn "features such as conditionals."
+               epause 5
+       fi
+}
+
 src_unpack() {
        unpack ${A}
        cd ${S}
 
-#    EPATCH_SUFFIX="diff" epatch ${FILESDIR}/${PV}
+       EPATCH_SUFFIX="diff" epatch ${FILESDIR}/${PV}
+
+       einfo "Regenerating autoconf/automake files"
+       libtoolize --copy --force || die "libtoolize failed"
+       aclocal || die "aclocal failed"
+       autoheader || die "autoheader failed"
+       automake --add-missing --copy || die "automake failed"
+       autoconf || die "autoconf failed"
 
        # dev-python/docutils installs rst2html.py not rst2html
        sed -i -e 's|\(rst2html\)|\1.py|g' doc/Makefile.in || \
                die "sed doc/Makefile.in failed"
+
+       sed -i -e 's|^\(.*UNUSED(regex).*\)$||' src/mod_dirlisting.c || \
+               die "sed src/mod_dirlisting.c failed"
 }
 
 src_compile() {
-#    einfo "Regenerating autoconf/automake files"
-#    libtoolize --copy --force || die "libtoolize failed"
-#    aclocal || die "aclocal failed"
-#    autoheader || die "autoheader failed"
-#    automake --add-missing --copy || die "automake failed"
-#    autoconf || die "autoconf failed"
-
        econf --libdir=/usr/$(get_libdir)/${PN} \
                --enable-lfs \
                $(use_enable ipv6) \
-               $(use_with fam gamin) \
+               $(use_with fam) \
                $(use_with gdbm) \
                $(use_with lua) \
                $(use_with ldap) \
                $(use_with mysql) \
+               $(use_with pcre) \
                $(use_with ssl openssl) \
                $(use_with webdav webdav-props) \
                $(use_with xattr attr) \
@@ -126,13 +140,13 @@ src_install() {
        insinto /etc/logrotate.d
        newins ${FILESDIR}/lighttpd.logrotate lighttpd || die
 
-       keepdir /var/log/lighttpd /var/www/localhost/htdocs
+       keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs
 }
 
 pkg_preinst() {
        enewgroup lighttpd
        enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd
-       fowners lighttpd:lighttpd /var/log/lighttpd
+       fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd
 }
 
 pkg_postinst () {
@@ -145,7 +159,7 @@ pkg_postinst () {
        fi
 
        if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then
-               ewarn "As of lighttpd-1.4.0-r1, Gentoo has a customized configuration,"
+               ewarn "As of lighttpd-1.4.1, Gentoo has a customized configuration,"
                ewarn "which is now located in /etc/lighttpd.  Please migrate your"
                ewarn "existing configuration."
                ebeep 3