diff options
author | Thilo Bangert <bangert@gentoo.org> | 2006-05-30 18:11:57 +0000 |
---|---|---|
committer | Thilo Bangert <bangert@gentoo.org> | 2006-05-30 18:11:57 +0000 |
commit | 0eb0c7c9c5fe9a5d4f2f4f6ebcea8ac9dc94dfc4 (patch) | |
tree | 8bf27b7b7fe81aa4b591bfccc046d7c3ff33179f /www-servers | |
parent | ppc stable, bug #133699 (diff) | |
download | gentoo-2-0eb0c7c9c5fe9a5d4f2f4f6ebcea8ac9dc94dfc4.tar.gz gentoo-2-0eb0c7c9c5fe9a5d4f2f4f6ebcea8ac9dc94dfc4.tar.bz2 gentoo-2-0eb0c7c9c5fe9a5d4f2f4f6ebcea8ac9dc94dfc4.zip |
version bump, #126603, #123022 - thanks to Joshua Schmidlkofer, Neil Dökkalfar, Jochen Schalanda
(Portage version: 2.0.54-r2)
Diffstat (limited to 'www-servers')
10 files changed, 677 insertions, 2 deletions
diff --git a/www-servers/lighttpd/ChangeLog b/www-servers/lighttpd/ChangeLog index 955e74b84cd4..9e0a85065bdb 100644 --- a/www-servers/lighttpd/ChangeLog +++ b/www-servers/lighttpd/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for www-servers/lighttpd # Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/ChangeLog,v 1.69 2006/05/24 16:57:24 ranger Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/ChangeLog,v 1.70 2006/05/30 18:11:57 bangert Exp $ + +*lighttpd-1.4.11 (30 May 2006) + + 30 May 2006; Thilo Bangert <bangert@gentoo.org> + +files/1.4.11/01_r1046.diff_mod_compress.c-fixes.diff, + +files/1.4.11/02_r1057_fix_If-Modified-Since-ETag.diff, + +files/1.4.11/03_r1095_fix_stalling_SSL_POST_requests.diff, + +files/1.4.11/04_r1116_fix_env_conf_segfault.diff, + +files/1.4.11/21_mod_scgi_segfault.diff, + +files/1.4.11/22_bug606_fix_SSI_echo.diff, +lighttpd-1.4.11.ebuild: + version bump 24 May 2006; Brent Baude <ranger@gentoo.org> lighttpd-1.4.8.ebuild: Stabilizing lighttpd-1.4.8 for ppc64 to satisfy cacti dependancy diff --git a/www-servers/lighttpd/Manifest b/www-servers/lighttpd/Manifest index b285ecb0a275..27353623a835 100644 --- a/www-servers/lighttpd/Manifest +++ b/www-servers/lighttpd/Manifest @@ -1,4 +1,4 @@ -MD5 b862b97ac2fd28f5aff14ea64a74a789 ChangeLog 20161 +MD5 53e260f8509061afe38f88d77937a721 ChangeLog 20602 MD5 24669453e8f69faf4212dfa43e90e3dd files/1.4.10/01_all_r990_mod_cgi_dont_reset_physical_path.diff 517 MD5 8c00894c801011ca682400a243aa49cb files/1.4.10/02_all_r991_posix_fadvise.diff 805 MD5 f9b6a2f0c377777945de48d3e7bdda40 files/1.4.10/03_all_r992_posix_fadvise_2.4.x.diff 638 @@ -13,6 +13,12 @@ MD5 1df4960f248d3a9bdf8c0df9e870cf83 files/1.4.10/11_all_r1002_var_and_env_docs. MD5 35434778a8946f35db7f1de508e9d671 files/1.4.10/12_all_r1003_mod_fastcgi_doc_fix.diff 543 MD5 3ee9e11b239661b01e45c56381c49d7d files/1.4.10/13_all_r1006_mod_cgi_close_unused_pipe_fds.diff 1987 MD5 81e540213c5ca381e6b82e51571c6874 files/1.4.10/14_all_r1007_mod_alias_lowercase_support.diff 695 +MD5 1b3bebe51407cf5a2f406a53465d9901 files/1.4.11/01_r1046.diff_mod_compress.c-fixes.diff 5992 +MD5 322a27dd300158534f8cb65ffad9e03d files/1.4.11/02_r1057_fix_If-Modified-Since-ETag.diff 2464 +MD5 efe7fb8d01b34d2bef55f80b450f7a86 files/1.4.11/03_r1095_fix_stalling_SSL_POST_requests.diff 500 +MD5 bb877e9c7fb8d9b0ecc940207fb287e5 files/1.4.11/04_r1116_fix_env_conf_segfault.diff 282 +MD5 560787bd4caa409af1cebdb03a76bebc files/1.4.11/21_mod_scgi_segfault.diff 458 +MD5 d1027d3e457185a382d4f6457e95bb3b files/1.4.11/22_bug606_fix_SSI_echo.diff 4905 MD5 df5b2360ea380d988bf16905ab214286 files/conf/lighttpd.conf 8182 MD5 fef397e7bcf1b741dea211a555e1803c files/conf/mime-types.conf 3291 MD5 9c1407e95f62ed22da66c4ef5f69c3b5 files/conf/mod_cgi.conf 869 @@ -21,6 +27,7 @@ MD5 16c832beb1879cbc2cc6814d1a2786a1 files/digest-lighttpd-1.3.13-r3 247 MD5 669eed61cca360d002ddb0c7efe0afe5 files/digest-lighttpd-1.3.16 247 MD5 03f615e79bba7ff75a6ba9a3e486fec4 files/digest-lighttpd-1.4.10-r1 247 MD5 03f615e79bba7ff75a6ba9a3e486fec4 files/digest-lighttpd-1.4.10-r2 247 +MD5 7b15f03282e2cab51e8e74bfa2eb12c5 files/digest-lighttpd-1.4.11 67 MD5 485267c1ac751168ebdd83d45237cfa7 files/digest-lighttpd-1.4.7 244 MD5 07e5b40d581e4881f7e8fbb6277b4ad3 files/digest-lighttpd-1.4.8 244 MD5 7fdb430fc7240e6e6a9078e4e57f6322 files/lighttpd-1.3.10.initd 666 @@ -39,6 +46,7 @@ MD5 f18029dea31126d04d7287f80610b2ca lighttpd-1.3.13-r3.ebuild 2649 MD5 0df89754aec138ad20821ef93c45833b lighttpd-1.3.16.ebuild 2589 MD5 051c33f9eaa96575c4e85ff92ee8b149 lighttpd-1.4.10-r1.ebuild 5028 MD5 6ace08416c92fb7660ab425f0b3927a7 lighttpd-1.4.10-r2.ebuild 5047 +MD5 aeb3018a0884824ce7edb46600c793b7 lighttpd-1.4.11.ebuild 5090 MD5 409c3573899a53281837a5bcb1bb1813 lighttpd-1.4.7.ebuild 5153 MD5 9a318d179b54cb88bd1c8ac45a1e643b lighttpd-1.4.8.ebuild 5156 MD5 6a9d4814404d8d51327e5b8306ee3d7e metadata.xml 726 diff --git a/www-servers/lighttpd/files/1.4.11/01_r1046.diff_mod_compress.c-fixes.diff b/www-servers/lighttpd/files/1.4.11/01_r1046.diff_mod_compress.c-fixes.diff new file mode 100644 index 000000000000..fdb419913939 --- /dev/null +++ b/www-servers/lighttpd/files/1.4.11/01_r1046.diff_mod_compress.c-fixes.diff @@ -0,0 +1,186 @@ +--- lighttpd-1.4.11.orig/src/mod_compress.c (revision 861) ++++ lighttpd-1.4.11/src/mod_compress.c (revision 1046) +@@ -15,4 +15,5 @@ + #include "response.h" + #include "stat_cache.h" ++#include "http_chunk.h" + + #include "plugin.h" +@@ -327,4 +328,7 @@ + const char *filename = fn->ptr; + ssize_t r; ++ stat_cache_entry *compressed_sce = NULL; ++ ++ if (buffer_is_empty(p->conf.compress_cache_dir)) return -1; + + /* overflow */ +@@ -384,25 +388,32 @@ + + buffer_append_string_buffer(p->ofn, sce->etag); ++ ++ ++ if (HANDLER_ERROR != stat_cache_get_entry(srv, con, p->ofn, &compressed_sce)) { ++ /* file exists */ ++ ++ http_chunk_append_file(srv, con, p->ofn, 0, compressed_sce->st.st_size); ++ con->file_finished = 1; ++ ++ return 0; ++ } + + if (-1 == (ofd = open(p->ofn->ptr, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0600))) { + if (errno == EEXIST) { + /* cache-entry exists */ +-#if 0 +- log_error_write(srv, __FILE__, __LINE__, "bs", p->ofn, "compress-cache hit"); +-#endif +- buffer_copy_string_buffer(con->physical.path, p->ofn); +- +- return 0; ++ + } + +- log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cachefile", p->ofn, "failed", strerror(errno)); +- +- return -1; +- } +-#if 0 +- log_error_write(srv, __FILE__, __LINE__, "bs", p->ofn, "compress-cache miss"); +-#endif ++ log_error_write(srv, __FILE__, __LINE__, "sbss", ++ "creating cachefile", p->ofn, ++ "failed", strerror(errno)); ++ ++ return -1; ++ } ++ + if (-1 == (ifd = open(filename, O_RDONLY | O_BINARY))) { +- log_error_write(srv, __FILE__, __LINE__, "sbss", "opening plain-file", fn, "failed", strerror(errno)); ++ log_error_write(srv, __FILE__, __LINE__, "sbss", ++ "opening plain-file", fn, ++ "failed", strerror(errno)); + + close(ofd); +@@ -413,5 +424,7 @@ + + if (MAP_FAILED == (start = mmap(NULL, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) { +- log_error_write(srv, __FILE__, __LINE__, "sbss", "mmaping", fn, "failed", strerror(errno)); ++ log_error_write(srv, __FILE__, __LINE__, "sbss", ++ "mmaping", fn, ++ "failed", strerror(errno)); + + close(ofd); +@@ -456,6 +469,7 @@ + if (ret != 0) return -1; + +- buffer_copy_string_buffer(con->physical.path, p->ofn); +- ++ http_chunk_append_file(srv, con, p->ofn, 0, r); ++ con->file_finished = 1; ++ + return 0; + } +@@ -477,5 +491,4 @@ + if (sce->st.st_size > 128 * 1024 * 1024) return -1; + +- + if (-1 == (ifd = open(fn->ptr, O_RDONLY | O_BINARY))) { + log_error_write(srv, __FILE__, __LINE__, "sbss", "opening plain-file", fn, "failed", strerror(errno)); +@@ -483,13 +496,15 @@ + return -1; + } +- +- +- if (MAP_FAILED == (start = mmap(NULL, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) { ++ ++ start = mmap(NULL, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0); ++ ++ close(ifd); ++ ++ if (MAP_FAILED == start) { + log_error_write(srv, __FILE__, __LINE__, "sbss", "mmaping", fn, "failed", strerror(errno)); + +- close(ifd); +- return -1; +- } +- ++ return -1; ++ } ++ + switch(type) { + #ifdef USE_ZLIB +@@ -512,5 +527,4 @@ + + munmap(start, sce->st.st_size); +- close(ifd); + + if (ret != 0) return -1; +@@ -589,4 +603,7 @@ + /* don't compress files that are too large as we need to much time to handle them */ + if (max_fsize && (sce->st.st_size >> 10) > max_fsize) return HANDLER_GO_ON; ++ ++ /* compressing the file might lead to larger files instead */ ++ if (sce->st.st_size < 128) return HANDLER_GO_ON; + + /* check if mimetype is in compress-config */ +@@ -639,5 +656,18 @@ + const char *compression_name = NULL; + int compression_type = 0; ++ buffer *mtime; + ++ mtime = strftime_cache_get(srv, sce->st.st_mtime); ++ etag_mutate(con->physical.etag, sce->etag); ++ ++ response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); ++ response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); ++ ++ /* perhaps we don't even have to compress the file as the browser still has the ++ * current version */ ++ if (HANDLER_FINISHED == http_response_handle_cachable(srv, con, mtime)) { ++ return HANDLER_FINISHED; ++ } ++ + /* select best matching encoding */ + if (matched_encodings & HTTP_ACCEPT_ENCODING_BZIP2) { +@@ -652,28 +682,18 @@ + } + +- /* deflate it */ +- if (p->conf.compress_cache_dir->used) { +- if (0 == deflate_file_to_file(srv, con, p, +- con->physical.path, sce, compression_type)) { +- buffer *mtime; ++ /* deflate it to file (cached) or to memory */ ++ if (0 == deflate_file_to_file(srv, con, p, ++ con->physical.path, sce, compression_type) || ++ 0 == deflate_file_to_buffer(srv, con, p, ++ con->physical.path, sce, compression_type)) { + +- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name)); +- +- mtime = strftime_cache_get(srv, sce->st.st_mtime); +- response_header_overwrite(srv, con, CONST_STR_LEN("Last-Modified"), CONST_BUF_LEN(mtime)); +- +- etag_mutate(con->physical.etag, sce->etag); +- response_header_overwrite(srv, con, CONST_STR_LEN("ETag"), CONST_BUF_LEN(con->physical.etag)); +- +- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); +- +- return HANDLER_GO_ON; +- } +- } else if (0 == deflate_file_to_buffer(srv, con, p, +- con->physical.path, sce, compression_type)) { +- +- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Encoding"), compression_name, strlen(compression_name)); +- response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_BUF_LEN(sce->content_type)); +- ++ response_header_overwrite(srv, con, ++ CONST_STR_LEN("Content-Encoding"), ++ compression_name, strlen(compression_name)); ++ ++ response_header_overwrite(srv, con, ++ CONST_STR_LEN("Content-Type"), ++ CONST_BUF_LEN(sce->content_type)); ++ + return HANDLER_FINISHED; + } diff --git a/www-servers/lighttpd/files/1.4.11/02_r1057_fix_If-Modified-Since-ETag.diff b/www-servers/lighttpd/files/1.4.11/02_r1057_fix_If-Modified-Since-ETag.diff new file mode 100644 index 000000000000..b1fc8340fcba --- /dev/null +++ b/www-servers/lighttpd/files/1.4.11/02_r1057_fix_If-Modified-Since-ETag.diff @@ -0,0 +1,85 @@ +--- lighttpd-1.4.11.orig/src/http-header-glue.c (revision 989) ++++ lighttpd-1.4.11/src/http-header-glue.c (revision 1057) +@@ -263,24 +263,9 @@ + } else { + char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")]; +- +- /* convert to timestamp */ +- if (used_len < sizeof(buf)) { +- time_t t_header, t_file; +- struct tm tm; +- +- strncpy(buf, con->request.http_if_modified_since, used_len); +- buf[used_len] = '\0'; +- +- strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm); +- t_header = mktime(&tm); +- +- strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm); +- t_file = mktime(&tm); +- +- if (t_file > t_header) { +- con->http_status = 304; +- return HANDLER_FINISHED; +- } +- } else { ++ time_t t_header, t_file; ++ struct tm tm; ++ ++ /* check if we can safely copy the string */ ++ if (used_len >= sizeof(buf)) { + log_error_write(srv, __FILE__, __LINE__, "ssdd", + "DEBUG: Last-Modified check failed as the received timestamp was too long:", +@@ -290,4 +275,19 @@ + return HANDLER_FINISHED; + } ++ ++ ++ strncpy(buf, con->request.http_if_modified_since, used_len); ++ buf[used_len] = '\0'; ++ ++ strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm); ++ t_header = mktime(&tm); ++ ++ strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm); ++ t_file = mktime(&tm); ++ ++ if (t_file > t_header) return HANDLER_GO_ON; ++ ++ con->http_status = 304; ++ return HANDLER_FINISHED; + } + } else { +@@ -303,5 +303,5 @@ + size_t used_len; + char *semicolon; +- ++ + if (NULL == (semicolon = strchr(con->request.http_if_modified_since, ';'))) { + used_len = strlen(con->request.http_if_modified_since); +@@ -313,4 +313,25 @@ + con->http_status = 304; + return HANDLER_FINISHED; ++ } else { ++ char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")]; ++ time_t t_header, t_file; ++ struct tm tm; ++ ++ /* convert to timestamp */ ++ if (used_len >= sizeof(buf)) return HANDLER_GO_ON; ++ ++ strncpy(buf, con->request.http_if_modified_since, used_len); ++ buf[used_len] = '\0'; ++ ++ strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm); ++ t_header = mktime(&tm); ++ ++ strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm); ++ t_file = mktime(&tm); ++ ++ if (t_file > t_header) return HANDLER_GO_ON; ++ ++ con->http_status = 304; ++ return HANDLER_FINISHED; + } + } diff --git a/www-servers/lighttpd/files/1.4.11/03_r1095_fix_stalling_SSL_POST_requests.diff b/www-servers/lighttpd/files/1.4.11/03_r1095_fix_stalling_SSL_POST_requests.diff new file mode 100644 index 000000000000..672dc950b9bc --- /dev/null +++ b/www-servers/lighttpd/files/1.4.11/03_r1095_fix_stalling_SSL_POST_requests.diff @@ -0,0 +1,14 @@ +--- lighttpd-1.4.11.orig/src/connections.c (revision 1092) ++++ lighttpd-1.4.11/src/connections.c (revision 1095) +@@ -1182,4 +1182,11 @@ + con->state == CON_STATE_READ_POST) { + connection_handle_read_state(srv, con); ++ /** ++ * if SSL_read() is not readin in the full packet we won't get ++ * a fdevent as the low-level has already fetched everything. ++ * ++ * we have to call the state-engine to read the rest of the packet ++ */ ++ if (con->is_readable) joblist_append(srv, con); + } + diff --git a/www-servers/lighttpd/files/1.4.11/04_r1116_fix_env_conf_segfault.diff b/www-servers/lighttpd/files/1.4.11/04_r1116_fix_env_conf_segfault.diff new file mode 100644 index 000000000000..f79a1d10b5e9 --- /dev/null +++ b/www-servers/lighttpd/files/1.4.11/04_r1116_fix_env_conf_segfault.diff @@ -0,0 +1,8 @@ +--- branches/lighttpd-merge-1.4.x/src/configparser.y (revision 1078) ++++ branches/lighttpd-merge-1.4.x/src/configparser.y (revision 1116) +@@ -241,4 +241,5 @@ + } + else { ++ A = NULL; + fprintf(stderr, "Undefined env variable: %s\n", B->ptr + 4); + ctx->ok = 0; diff --git a/www-servers/lighttpd/files/1.4.11/21_mod_scgi_segfault.diff b/www-servers/lighttpd/files/1.4.11/21_mod_scgi_segfault.diff new file mode 100644 index 000000000000..6455c569231c --- /dev/null +++ b/www-servers/lighttpd/files/1.4.11/21_mod_scgi_segfault.diff @@ -0,0 +1,11 @@ +--- lighttpd-1.4.11.orig/src/mod_scgi.c 2006-04-05 19:29:01.000000000 +0200 ++++ lighttpd-1.4.11/src/mod_scgi.c 2006-04-05 19:27:32.000000000 +0200 +@@ -2536,7 +2536,7 @@ + return HANDLER_WAIT_FOR_FD; + } + +- log_error_write(srv, __FILE__, __LINE__, "sdsdsd", ++ log_error_write(srv, __FILE__, __LINE__, "sosdsd", + "response not sent, request sent:", hctx->wb->bytes_out, + "connection-fd:", con->fd, + "fcgi-fd:", hctx->fd); diff --git a/www-servers/lighttpd/files/1.4.11/22_bug606_fix_SSI_echo.diff b/www-servers/lighttpd/files/1.4.11/22_bug606_fix_SSI_echo.diff new file mode 100644 index 000000000000..6af338d91dd9 --- /dev/null +++ b/www-servers/lighttpd/files/1.4.11/22_bug606_fix_SSI_echo.diff @@ -0,0 +1,157 @@ +--- lighttpd-1.4.11.orig/src/mod_ssi.c Sun Apr 2 01:20:30 2006 ++++ lighttpd-1.4.11/src/mod_ssi.c.modify Sun Apr 2 01:21:05 2006 +@@ -36,6 +36,9 @@ + #include <sys/filio.h> + #endif + ++/* determine if process finished */ ++int h_finished = 0; ++ + /* init the plugin data */ + INIT_FUNC(mod_ssi_init) { + plugin_data *p; +@@ -57,7 +60,7 @@ FREE_FUNC(mod_ssi_free) { + UNUSED(srv); + + if (!p) return HANDLER_GO_ON; +- ++ + if (p->config_storage) { + size_t i; + for (i = 0; i < srv->config_context->used; i++) { +@@ -286,6 +289,37 @@ static int build_ssi_cgi_vars(server *sr + return 0; + } + ++URIHANDLER_FUNC(mod_ssi_physical_path) { ++ plugin_data *p = p_d; ++ size_t k; ++ ++ if (con->physical.path->used == 0) return HANDLER_GO_ON; ++ ++ con->loops_per_request++; ++ ++ mod_ssi_patch_connection(srv, con, p); ++ ++ for (k = 0; k < p->conf.ssi_extension->used; k++) { ++ data_string *ds = (data_string *)p->conf.ssi_extension->data[k]; ++ ++ if (ds->value->used == 0) continue; ++ ++ if (buffer_is_equal_right_len(con->physical.path, ds->value, ds->value->used - 1)) { ++ /* handle ssi-request */ ++ ++ if (mod_ssi_handle_request(srv, con, p)) { ++ /* on error */ ++ con->http_status = 500; ++ } ++ ++ return HANDLER_FINISHED; ++ } ++ } ++ ++ /* not found */ ++ return HANDLER_GO_ON; ++} ++ + static int process_ssi_stmt(server *srv, connection *con, plugin_data *p, + const char **l, size_t n) { + size_t i, ssicmd = 0; +@@ -467,7 +501,11 @@ static int process_ssi_stmt(server *srv, + if (NULL != (ds = (data_string *)array_get_element(p->ssi_cgi_env, var_val))) { + buffer_copy_string_buffer(b, ds->value); + } else { +- buffer_copy_string(b, "(none)"); ++ if (NULL != (ds = (data_string *)array_get_element(p->ssi_vars, var_val))) { ++ buffer_copy_string_buffer(b, ds->value); ++ } else { ++ buffer_copy_string(b, "(none)"); ++ } + } + + break; +@@ -481,6 +519,7 @@ static int process_ssi_stmt(server *srv, + const char * file_path = NULL, *virt_path = NULL; + struct stat st; + char *sl; ++ buffer *tmp; + + for (i = 2; i < n; i += 2) { + if (0 == strcmp(l[i], "file")) { +@@ -574,7 +613,26 @@ static int process_ssi_stmt(server *srv, + } + break; + case SSI_INCLUDE: +- chunkqueue_append_file(con->write_queue, p->stat_fn, 0, st.st_size); ++ /* do recursive SSI expansion */ ++ /* prevents infinite loop */ ++ if (con->loops_per_request > 25 || buffer_is_equal(con->physical.path, p->stat_fn)) { ++ buffer_copy_string(srv->tmp_buf, "<!-- your include directives create an infinite loop, aborting -->"); ++ chunkqueue_append_buffer(con->write_queue, srv->tmp_buf); ++ break; ++ } ++ ++ tmp = buffer_init(); ++ buffer_copy_string_buffer(tmp, con->physical.path); /* save path of current document */ ++ buffer_copy_string_buffer(con->physical.path, p->stat_fn); /* next sub-document to parse */ ++ if (mod_ssi_physical_path(srv, con, p) != HANDLER_FINISHED) { ++ /* the document was not processed, so write it as is */ ++ chunkqueue_append_file(con->write_queue, con->physical.path, 0, st.st_size); ++ } else { ++ h_finished = 1; ++ } ++ buffer_copy_string_buffer(con->physical.path, tmp); /* restore saved path */ ++ buffer_free(tmp); ++ + break; + } + } else { +@@ -897,7 +955,11 @@ static int mod_ssi_handle_request(server + + /* get a stream to the file */ + +- array_reset(p->ssi_vars); ++ if (h_finished == 1) ++ { ++ array_reset(p->ssi_vars); ++ h_finished = 0; ++ } + array_reset(p->ssi_cgi_env); + buffer_copy_string(p->timefmt, "%a, %d %b %Y %H:%M:%S %Z"); + p->sizefmt = 0; +@@ -1038,35 +1100,6 @@ static int mod_ssi_patch_connection(serv + } + #undef PATCH + +-URIHANDLER_FUNC(mod_ssi_physical_path) { +- plugin_data *p = p_d; +- size_t k; +- +- if (con->physical.path->used == 0) return HANDLER_GO_ON; +- +- mod_ssi_patch_connection(srv, con, p); +- +- for (k = 0; k < p->conf.ssi_extension->used; k++) { +- data_string *ds = (data_string *)p->conf.ssi_extension->data[k]; +- +- if (ds->value->used == 0) continue; +- +- if (buffer_is_equal_right_len(con->physical.path, ds->value, ds->value->used - 1)) { +- /* handle ssi-request */ +- +- if (mod_ssi_handle_request(srv, con, p)) { +- /* on error */ +- con->http_status = 500; +- } +- +- return HANDLER_FINISHED; +- } +- } +- +- /* not found */ +- return HANDLER_GO_ON; +-} +- + /* this function is called at dlopen() time and inits the callbacks */ + + int mod_ssi_plugin_init(plugin *p) { diff --git a/www-servers/lighttpd/files/digest-lighttpd-1.4.11 b/www-servers/lighttpd/files/digest-lighttpd-1.4.11 new file mode 100644 index 000000000000..f33ab3decf32 --- /dev/null +++ b/www-servers/lighttpd/files/digest-lighttpd-1.4.11 @@ -0,0 +1 @@ +MD5 f55eebb9815c94a7de35906bb557ecd3 lighttpd-1.4.11.tar.gz 781656 diff --git a/www-servers/lighttpd/lighttpd-1.4.11.ebuild b/www-servers/lighttpd/lighttpd-1.4.11.ebuild new file mode 100644 index 000000000000..662e5559d19a --- /dev/null +++ b/www-servers/lighttpd/lighttpd-1.4.11.ebuild @@ -0,0 +1,194 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.11.ebuild,v 1.1 2006/05/30 18:11:57 bangert Exp $ + +inherit eutils autotools depend.php + +DESCRIPTION="Lightweight high-performance web server" +HOMEPAGE="http://www.lighttpd.net/" +SRC_URI="http://www.lighttpd.net/download/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="bzip2 doc fam fastcgi gdbm ipv6 ldap lua minimal memcache mysql pcre php rrdtool ssl test webdav xattr" + +RDEPEND=">=sys-libs/zlib-1.1 + bzip2? ( app-arch/bzip2 ) + fam? ( virtual/fam ) + gdbm? ( sys-libs/gdbm ) + ldap? ( >=net-nds/openldap-2.1.26 ) + lua? ( dev-lang/lua ) + memcache? ( dev-libs/libmemcache ) + mysql? ( >=dev-db/mysql-4.0.0 ) + pcre? ( >=dev-libs/libpcre-3.1 ) + php? ( + virtual/httpd-php + !net-www/spawn-fcgi + ) + rrdtool? ( net-analyzer/rrdtool ) + ssl? ( >=dev-libs/openssl-0.9.7 ) + webdav? ( + dev-libs/libxml2 + >=dev-db/sqlite-3 + ) + xattr? ( kernel_linux? ( sys-apps/attr ) )" + +DEPEND="${RDEPEND} + doc? ( dev-python/docutils ) + test? ( + virtual/perl-Test-Harness + dev-libs/fcgi + )" + +# update certain parts of lighttpd.conf based on conditionals +update_config() { + local config="/etc/lighttpd/lighttpd.conf" + + # enable php/mod_fastcgi settings + use php && \ + dosed 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} + + # enable stat() caching + use fam && \ + dosed 's|#\(.*stat-cache.*$\)|\1|' ${config} +} + +# remove non-essential stuff (for USE=minimal) +remove_non_essential() { + local libdir="${D}/usr/$(get_libdir)/${PN}" + + # text docs + use doc || rm -fr ${D}/usr/share/doc/${PF}/txt + + # non-essential modules + rm -f \ + ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.* + + # allow users to keep some based on USE flags + use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.* + use webdav || rm -f ${libdir}/mod_webdav.* + use mysql || rm -f ${libdir}/mod_mysql_vhost.* + use lua || rm -f ${libdir}/mod_cml.* + use rrdtool || rm -f ${libdir}/mod_rrdtool.* + + if ! use fastcgi ; then + rm -f ${libdir}/mod_fastcgi.* ${D}/usr/bin/spawn-fcgi \ + ${D}/usr/share/man/man1/spawn-fcgi.* + fi +} + +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 such" + ewarn "as conditionals and modules such as mod_re{write,direct}" + ewarn "and mod_ssi." + ebeep 5 + fi + + use php && require_php_with_use cgi + + enewgroup lighttpd + enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd +} + +src_unpack() { + unpack ${A} + cd ${S} + + EPATCH_SUFFIX="diff" epatch ${FILESDIR}/${PV} || die "Patching failed!" + + eautoreconf || die + + # 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" + + # fix typo + sed -i -e 's|\(output_content\)_\(type\)|\1\2|' doc/cml.txt || \ + die "sed doc/cml.txt failed" +} + +src_compile() { + econf --libdir=/usr/$(get_libdir)/${PN} \ + --enable-lfs \ + $(use_enable ipv6) \ + $(use_with bzip2) \ + $(use_with fam) \ + $(use_with gdbm) \ + $(use_with lua) \ + $(use_with ldap) \ + $(use_with memcache) \ + $(use_with mysql) \ + $(use_with pcre) \ + $(use_with ssl openssl) \ + $(use_with webdav webdav-props) \ + $(use_with xattr attr) \ + || die "econf failed" + + emake || die "emake failed" + + if use doc ; then + einfo "Building HTML documentation" + cd doc + emake html || die "failed to build HTML documentation" + fi +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + # init script stuff + newinitd ${FILESDIR}/lighttpd.initd lighttpd || die + + if use php || use fastcgi ; then + newinitd ${FILESDIR}/spawn-fcgi.initd spawn-fcgi || die + newconfd ${FILESDIR}/spawn-fcgi.confd spawn-fcgi || die + fi + + # configs + insinto /etc/lighttpd + doins ${FILESDIR}/conf/*.conf + + # update lighttpd.conf directives based on conditionals + update_config + + # docs + dodoc AUTHORS README COPYING INSTALL NEWS ChangeLog doc/*.sh + newdoc doc/lighttpd.conf lighttpd.conf.distrib + + use doc && dohtml -r doc/* + + docinto txt + dodoc doc/*.txt + + # logrotate + insinto /etc/logrotate.d + newins ${FILESDIR}/lighttpd.logrotate lighttpd || die + + keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs + fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd + fperms 0750 /var/l{ib,og}/lighttpd + + use minimal && remove_non_essential +} + +pkg_postinst () { + echo + if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then + einfo "spawn-fcgi is now included with lighttpd" + einfo "spawn-fcgi's init script configuration is now located" + einfo "at /etc/conf.d/spawn-fcgi." + echo + fi + + if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then + 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 5 + fi + echo +} |