lighttpd: build and bugfix patches
authorGlenn Strauss <redacted>
Tue, 1 Dec 2020 22:38:38 +0000 (17:38 -0500)
committerGlenn Strauss <redacted>
Tue, 1 Dec 2020 22:40:10 +0000 (17:40 -0500)
Signed-off-by: Glenn Strauss <redacted>
net/lighttpd/Makefile
net/lighttpd/patches/010-meson-lua.patch [new file with mode: 0644]
net/lighttpd/patches/020-webdav-atfile.patch [new file with mode: 0644]
net/lighttpd/patches/030-one-shot-pipes.patch [new file with mode: 0644]

index 3d47ffe0d020be665ca426fbecaf39b5e6653417..4f4fe2b0d638c636ce984fc117f7d8040bf160ad 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lighttpd
 PKG_VERSION:=1.4.56
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 # release candidate ~rcX testing; remove for release
 #PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-1.4.56
 
diff --git a/net/lighttpd/patches/010-meson-lua.patch b/net/lighttpd/patches/010-meson-lua.patch
new file mode 100644 (file)
index 0000000..d1c96c8
--- /dev/null
@@ -0,0 +1,30 @@
+From f47d569311d51ec9ab5dad7452b43c1b5a8290b6 Mon Sep 17 00:00:00 2001
+From: Glenn Strauss <gstrauss@gluelogic.com>
+Date: Tue, 1 Dec 2020 16:41:58 -0500
+Subject: [PATCH] [PATCH] [meson] do not search for lua versions
+
+openwrt net/lighttpd/Makefile declares dependency on liblua, and not on
+specific lua versions, so have meson.build look for 'lua' and not for
+specific lua versions.
+
+Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
+---
+ src/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/meson.build b/src/meson.build
+index 71e4ec90..14ed9cec 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -381,7 +381,7 @@ endif
+ liblua = []
+ if get_option('with_lua')
+       found_lua = false
+-      foreach l: ['lua5.4', 'lua-5.4', 'lua5.3', 'lua-5.3', 'lua5.2', 'lua-5.2', 'lua5.1', 'lua-5.1', 'lua']
++      foreach l: ['lua']
+               if not(found_lua)
+                       liblua = dependency(l, required: false)
+                       if (liblua.found())
+-- 
+2.28.0
+
diff --git a/net/lighttpd/patches/020-webdav-atfile.patch b/net/lighttpd/patches/020-webdav-atfile.patch
new file mode 100644 (file)
index 0000000..6cf4e25
--- /dev/null
@@ -0,0 +1,78 @@
+From 2a1e55dc62c72893d128400334131a56a218ee1a Mon Sep 17 00:00:00 2001
+From: Glenn Strauss <gstrauss@gluelogic.com>
+Date: Tue, 1 Dec 2020 16:23:49 -0500
+Subject: [PATCH] [mod_webdav] define _ATFILE_SOURCE if AT_FDCWD
+
+Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
+---
+ src/mod_webdav.c | 15 ++++++++++++---
+ 1 file changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/src/mod_webdav.c b/src/mod_webdav.c
+index c3fe79a2..9c27ad8f 100644
+--- a/src/mod_webdav.c
++++ b/src/mod_webdav.c
+@@ -182,9 +182,18 @@
+ #include <string.h>
+ #include <unistd.h>     /* getpid() linkat() rmdir() unlinkat() */
+-/* Note: filesystem access race conditions exist without _ATFILE_SOURCE */
++#ifdef AT_FDCWD
+ #ifndef _ATFILE_SOURCE
++#define _ATFILE_SOURCE
++#endif
++#endif
++
++#ifndef AT_SYMLINK_NOFOLLOW
+ #define AT_SYMLINK_NOFOLLOW 0
++#endif
++
++/* Note: filesystem access race conditions exist without _ATFILE_SOURCE */
++#ifndef _ATFILE_SOURCE
+ /*(trigger linkat() fail to fallback logic in mod_webdav.c)*/
+ #define linkat(odfd,opath,ndfd,npath,flags) -1
+ #endif
+@@ -2371,7 +2380,10 @@ webdav_delete_dir (const plugin_config * const pconf,
+         buffer_append_string_len(&dst->rel_path, de->d_name, len);
+       #ifndef _ATFILE_SOURCE
+-      #ifndef _DIRENT_HAVE_D_TYPE
++      #ifdef _DIRENT_HAVE_D_TYPE
++      if (de->d_type == DT_UNKNOWN)
++      #endif
++      {
+         struct stat st;
+         if (0 != stat(dst->path.ptr, &st)) {
+             dst->path.ptr[    (dst->path.used     = dst_path_used)    -1]='\0';
+@@ -2379,6 +2391,6 @@ webdav_delete_dir (const plugin_config * const pconf,
+             continue; /* file *just* disappeared? */
+         }
+         s_isdir = S_ISDIR(st.st_mode);
+-      #endif
++      }
+       #endif
+@@ -2903,7 +2902,10 @@ webdav_copymove_dir (const plugin_config * const pconf,
+         buffer_append_string_len(&dst->rel_path, de->d_name, len);
+       #ifndef _ATFILE_SOURCE
+-      #ifndef _DIRENT_HAVE_D_TYPE
++      #ifdef _DIRENT_HAVE_D_TYPE
++      if (de->d_type == DT_UNKNOWN)
++      #endif
++      {
+         if (0 != stat(src->path.ptr, &st)) {
+             src->path.ptr[    (src->path.used     = src_path_used)    -1]='\0';
+             src->rel_path.ptr[(src->rel_path.used = src_rel_path_used)-1]='\0';
+@@ -2912,7 +2914,7 @@ webdav_copymove_dir (const plugin_config * const pconf,
+             continue; /* file *just* disappeared? */
+         }
+         d_type = st.st_mode;
+-      #endif
++      }
+       #endif
+         if (S_ISDIR(d_type)) { /* recursive call; depth first */
+-- 
+2.28.0
+
diff --git a/net/lighttpd/patches/030-one-shot-pipes.patch b/net/lighttpd/patches/030-one-shot-pipes.patch
new file mode 100644 (file)
index 0000000..a4762d4
--- /dev/null
@@ -0,0 +1,26 @@
+From 716e4d7a5d773607d87d5521f5943cff019bcd97 Mon Sep 17 00:00:00 2001
+From: Glenn Strauss <gstrauss@gluelogic.com>
+Date: Mon, 30 Nov 2020 19:31:05 -0500
+Subject: [PATCH] [core] fix lighttpd -1 one-shot with pipes
+
+Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
+---
+ src/server.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/server.c b/src/server.c
+index 83c0241f..a781027e 100644
+--- a/src/server.c
++++ b/src/server.c
+@@ -356,7 +356,7 @@ static int server_oneshot_read_cq(connection *con, chunkqueue *cq, off_t max_byt
+     /* temporary set con->fd to oneshot_fd (fd input) rather than outshot_fdout
+      * (lighttpd generally assumes operation on sockets, so this is a kludge) */
+     int fd = con->fd;
+-    con->fd = oneshot_fd;
++    con->fd = oneshot_fdn->fd;
+     int rc = oneshot_read_cq(con, cq, max_bytes);
+     con->fd = fd;
+-- 
+2.28.0
+
git clone https://git.99rst.org/PROJECT