From 2e0e767f9367989b66c74c9c27b632c7e1940943 Mon Sep 17 00:00:00 2001 From: Guido Witmond Date: Thu, 31 Dec 2015 16:43:54 +0100 Subject: [PATCH] Upgrade lighttpd to 1.4.38 Fixes #1839 --- repos/ports/ports/lighttpd.hash | 2 +- repos/ports/ports/lighttpd.inc | 3 +- repos/ports/ports/lighttpd.port | 4 +- .../disable_gethostbyaddr_fcntl.patch | 38 ++++++++++--------- repos/ports/src/app/lighttpd/target.inc | 2 +- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/repos/ports/ports/lighttpd.hash b/repos/ports/ports/lighttpd.hash index a7ec090a20..e2fc84ebaf 100644 --- a/repos/ports/ports/lighttpd.hash +++ b/repos/ports/ports/lighttpd.hash @@ -1 +1 @@ -cf80d75a9625c6d11ede200b7ee1cccffb16d5b0 +33ef60a93420294641033417ab35d36d76372c93 diff --git a/repos/ports/ports/lighttpd.inc b/repos/ports/ports/lighttpd.inc index 615a1810a0..ea90bc2883 100644 --- a/repos/ports/ports/lighttpd.inc +++ b/repos/ports/ports/lighttpd.inc @@ -1,6 +1,5 @@ LIGHTTPD_MAIN := 1 LIGHTTPD_MAJOR := 4 -LIGHTTPD_MINOR := 31 +LIGHTTPD_MINOR := 38 LIGHTTPD_VERSION := $(LIGHTTPD_MAIN).$(LIGHTTPD_MAJOR).$(LIGHTTPD_MINOR) LIGHTTPD := lighttpd-$(LIGHTTPD_VERSION) - diff --git a/repos/ports/ports/lighttpd.port b/repos/ports/ports/lighttpd.port index 950b6859ec..162b53bbe3 100644 --- a/repos/ports/ports/lighttpd.port +++ b/repos/ports/ports/lighttpd.port @@ -1,9 +1,9 @@ LICENSE := BSD -VERSION := 1.4.31 +VERSION := 1.4.38 DOWNLOADS := lighttpd.archive URL(lighttpd) := http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-$(VERSION).tar.gz -SHA(lighttpd) := 6b3babc9df173cea5ae4756c2fd6b0e85e015f2a +SHA(lighttpd) := c5333bafa266b3cb99c36f2f84dd50139c7aec14 SIG(lighttpd) := ${URL(lighttpd)}.asc KEY(lighttpd) := stbuehler@lighttpd.net DIR(lighttpd) := src/app/lighttpd diff --git a/repos/ports/src/app/lighttpd/disable_gethostbyaddr_fcntl.patch b/repos/ports/src/app/lighttpd/disable_gethostbyaddr_fcntl.patch index bf330956ed..7fdc3a96a2 100644 --- a/repos/ports/src/app/lighttpd/disable_gethostbyaddr_fcntl.patch +++ b/repos/ports/src/app/lighttpd/disable_gethostbyaddr_fcntl.patch @@ -9,7 +9,7 @@ return -1; +++ src/app/lighttpd/src/http-header-glue.c -@@ -175,6 +175,7 @@ int http_response_redirect_to_directory(server *srv, connection *con) { +@@ -172,6 +172,7 @@ int http_response_redirect_to_directory(server *srv, connection *con) { break; #endif case AF_INET: @@ -17,7 +17,7 @@ if (NULL == (he = gethostbyaddr((char *)&our_addr.ipv4.sin_addr, sizeof(struct in_addr), AF_INET))) { log_error_write(srv, __FILE__, __LINE__, "SdS", "NOTICE: gethostbyaddr failed: ", -@@ -184,6 +185,8 @@ int http_response_redirect_to_directory(server *srv, connection *con) { +@@ -181,6 +182,8 @@ int http_response_redirect_to_directory(server *srv, connection *con) { } else { buffer_append_string(o, he->h_name); } @@ -27,7 +27,7 @@ default: log_error_write(srv, __FILE__, __LINE__, +++ src/app/lighttpd/src/network.c -@@ -301,6 +301,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config +@@ -323,6 +323,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config if (host == NULL) { srv_socket->addr.ipv4.sin_addr.s_addr = htonl(INADDR_ANY); } else { @@ -35,7 +35,7 @@ struct hostent *he; if (NULL == (he = gethostbyname(host))) { log_error_write(srv, __FILE__, __LINE__, -@@ -320,6 +321,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config +@@ -342,6 +343,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config } memcpy(&(srv_socket->addr.ipv4.sin_addr.s_addr), he->h_addr_list[0], he->h_length); @@ -44,28 +44,32 @@ srv_socket->addr.ipv4.sin_port = htons(port); +++ src/app/lighttpd/src/fdevent.c -@@ -198,16 +198,23 @@ void * fdevent_get_context(fdevents *ev, int fd) { +@@ -201,15 +201,18 @@ + } + + void fd_close_on_exec(int fd) { ++#if 0 + #ifdef FD_CLOEXEC + if (fd < 0) return; + force_assert(-1 != fcntl(fd, F_SETFD, FD_CLOEXEC)); + #else + UNUSED(fd); + #endif ++#endif } int fdevent_fcntl_set(fdevents *ev, int fd) { +#if 0 - #ifdef FD_CLOEXEC - /* close fd on exec (cgi) */ - fcntl(fd, F_SETFD, FD_CLOEXEC); - #endif -- if ((ev) && (ev->fcntl_set)) return ev->fcntl_set(ev, fd); -+ if ((ev) && (ev->fcntl_set)){ -+ fprintf(stderr, "call ev->fcntl_set(ev, %d)\n", fd); -+ return ev->fcntl_set(ev, fd); -+ } + fd_close_on_exec(fd); + if ((ev) && (ev->fcntl_set)) return ev->fcntl_set(ev, fd); #ifdef O_NONBLOCK -+ fprintf(stderr, "call fcntl(ev, %d)\n", fd); - return fcntl(fd, F_SETFL, O_NONBLOCK | O_RDWR); +@@ -217,6 +220,9 @@ #else return 0; #endif -+#endif ++#else + return 0; ++#endif } diff --git a/repos/ports/src/app/lighttpd/target.inc b/repos/ports/src/app/lighttpd/target.inc index 8a7edf1088..2c71ac049e 100644 --- a/repos/ports/src/app/lighttpd/target.inc +++ b/repos/ports/src/app/lighttpd/target.inc @@ -15,7 +15,7 @@ LIGHTTPD_MAJOR := $(word 2,$(LIGHTTPD_VERSION)) LIGHTTPD_MINOR := $(word 3,$(LIGHTTPD_VERSION)) CC_OPT += -DHAVE_SOCKLEN_T -DHAVE_SYSLOG_H -DHAVE_STDINT_H -DUSE_POLL -CC_OPT += -DHAVE_SYS_WAIT_H -DHAVE_SYS_UN_H -DHAVE_MMAP -DHAVE_SELECT +CC_OPT += -DHAVE_SYS_WAIT_H -DHAVE_SYS_UN_H -DHAVE_MMAP -DHAVE_SYS_MMAN_H -DHAVE_SELECT CC_OPT += -DHAVE_WRITEV -DUSE_WRITEV CC_OPT += -DSBIN_DIR="\"/sbin\"" CC_OPT += -DPACKAGE_NAME="\"lighttpd\""