summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Rojas2022-04-01 19:58:52 +0200
committerAntonio Rojas2022-04-01 19:58:52 +0200
commit8d86c4d81dcffa210609938826c488a1ea456507 (patch)
tree8d65f1c8cea75c6eb3dbd5130d28ec18e41dd965
downloadaur-8d86c4d81dcffa210609938826c488a1ea456507.tar.gz
import from community
-rw-r--r--.SRCINFO19
-rw-r--r--30_fix-bts-691929.patch67
-rw-r--r--PKGBUILD37
-rw-r--r--large-file-upload.patch112
4 files changed, 235 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..e1f4a9efce3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = mod_fcgid
+ pkgdesc = A FastCGI module for Apache HTTP Server.
+ pkgver = 2.3.9
+ pkgrel = 5
+ url = https://httpd.apache.org/mod_fcgid/
+ arch = x86_64
+ license = APACHE
+ depends = apache
+ source = https://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-2.3.9.tar.bz2
+ source = https://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-2.3.9.tar.bz2.asc
+ source = 30_fix-bts-691929.patch
+ source = large-file-upload.patch
+ validpgpkeys = 5B5181C2C0AB13E59DA3F7A3EC582EB639FF092C
+ sha1sums = f0b6d87dfcfe18b318905a3f91274051f3f17945
+ sha1sums = SKIP
+ sha1sums = 661a16c15ba413cc841ef6ae0534a12eaee1b703
+ sha1sums = b281882ff13028a4c3d0c2189263eea12e1189df
+
+pkgname = mod_fcgid
diff --git a/30_fix-bts-691929.patch b/30_fix-bts-691929.patch
new file mode 100644
index 00000000000..80b1053673e
--- /dev/null
+++ b/30_fix-bts-691929.patch
@@ -0,0 +1,67 @@
+Description: Patch to set CONTENT_LENGTH FCGI params based on actual request body
+Author: Dominic Benson
+Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=53332
+
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' libapache2-mod-fcgid-2.3.6~/modules/fcgid/fcgid_spawn_ctl.c libapache2-mod-fcgid-2.3.6/modules/fcgid/fcgid_spawn_ctl.c
+--- mod_fcgid-2.3.6.orig/modules/fcgid/fcgid_bridge.c 2012-05-30 09:53:20.928783540 +0100
++++ mod_fcgid-2.3.6/modules/fcgid/fcgid_bridge.c 2012-05-30 18:04:01.648850877 +0100
+@@ -662,6 +662,11 @@ static int add_request_body(request_rec
+ apr_brigade_destroy(input_brigade);
+ apr_brigade_destroy(tmp_brigade);
+
++ char sizestr[21];
++ apr_snprintf(sizestr, sizeof sizestr, "%" APR_OFF_T_FMT, request_size);
++ apr_table_set(r->subprocess_env, "CONTENT_LENGTH", sizestr);
++ apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING");
++
+ /* Append an empty body stdin header */
+ stdin_request_header = apr_bucket_alloc(sizeof(FCGI_Header),
+ r->connection->bucket_alloc);
+@@ -682,31 +687,37 @@ static int add_request_body(request_rec
+ int bridge_request(request_rec * r, int role, fcgid_cmd_conf *cmd_conf)
+ {
+ apr_bucket_brigade *output_brigade;
++ apr_bucket_brigade *header_brigade;
+ apr_bucket *bucket_eos;
+- char **envp = ap_create_environment(r->pool,
+- r->subprocess_env);
+ int rc;
+
+ /* Create brigade for the request to fastcgi server */
+ output_brigade =
+ apr_brigade_create(r->pool, r->connection->bucket_alloc);
++ header_brigade =
++ apr_brigade_create(r->pool, r->connection->bucket_alloc);
++
++ if (role == FCGI_RESPONDER) {
++ rc = add_request_body(r, r->pool, output_brigade);
++ if (rc) {
++ return rc;
++ }
++ }
++
++ char **envp = ap_create_environment(r->pool,
++ r->subprocess_env);
+
+ /* Build the begin request and environ request, append them to output_brigade */
+ if (!build_begin_block
+- (role, r, r->connection->bucket_alloc, output_brigade)
++ (role, r, r->connection->bucket_alloc, header_brigade)
+ || !build_env_block(r, envp, r->connection->bucket_alloc,
+- output_brigade)) {
++ header_brigade)) {
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ "mod_fcgid: can't build begin or env request");
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+- if (role == FCGI_RESPONDER) {
+- rc = add_request_body(r, r->pool, output_brigade);
+- if (rc) {
+- return rc;
+- }
+- }
++ APR_BRIGADE_PREPEND(output_brigade,header_brigade);
+
+ /* The eos bucket now */
+ bucket_eos = apr_bucket_eos_create(r->connection->bucket_alloc);
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..27652c7356f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=mod_fcgid
+pkgver=2.3.9
+pkgrel=5
+pkgdesc="A FastCGI module for Apache HTTP Server."
+license=('APACHE')
+arch=('x86_64')
+url="https://httpd.apache.org/mod_fcgid/"
+depends=('apache')
+source=(https://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-$pkgver.tar.bz2{,.asc}
+30_fix-bts-691929.patch
+large-file-upload.patch)
+sha1sums=('f0b6d87dfcfe18b318905a3f91274051f3f17945'
+ 'SKIP'
+ '661a16c15ba413cc841ef6ae0534a12eaee1b703'
+ 'b281882ff13028a4c3d0c2189263eea12e1189df')
+validpgpkeys=('5B5181C2C0AB13E59DA3F7A3EC582EB639FF092C') # Jeff Trawick (CODE SIGNING KEY) <trawick@apache.org>
+
+prepare() {
+ cd $pkgname-$pkgver
+ patch -Np1 -i ../30_fix-bts-691929.patch
+ patch -Np0 -i ../large-file-upload.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+ ./configure.apxs
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+ rm -rf "${pkgdir}/usr/share"
+ rm -rf "${pkgdir}/etc"
+}
diff --git a/large-file-upload.patch b/large-file-upload.patch
new file mode 100644
index 00000000000..55f5ddcf274
--- /dev/null
+++ b/large-file-upload.patch
@@ -0,0 +1,112 @@
+--- modules/fcgid/fcgid_proc_win.c 2015-08-28 13:39:44.583673500 +0200
++++ modules/fcgid/fcgid_proc_win.c 2015-08-28 13:40:05.588100000 +0200
+@@ -380,19 +380,22 @@
+ apr_bucket *bucket_request;
+ apr_status_t rv;
+ DWORD transferred;
++ apr_bucket_brigade* tmpbb = apr_brigade_create(birgade_send->p,
++ birgade_send->bucket_alloc);
+
+ handle_info = (fcgid_namedpipe_handle *) ipc_handle->ipc_handle_info;
+
+- for (bucket_request = APR_BRIGADE_FIRST(birgade_send);
+- bucket_request != APR_BRIGADE_SENTINEL(birgade_send);
+- bucket_request = APR_BUCKET_NEXT(bucket_request))
+- {
++ while (!APR_BRIGADE_EMPTY(birgade_send)) {
+ const char *write_buf;
+ apr_size_t write_buf_len;
+ apr_size_t has_write;
+
+- if (APR_BUCKET_IS_METADATA(bucket_request))
++ bucket_request = APR_BRIGADE_FIRST(birgade_send);
++
++ if (APR_BUCKET_IS_METADATA(bucket_request)) {
++ apr_bucket_delete(bucket_request);
+ continue;
++ }
+
+ if ((rv = apr_bucket_read(bucket_request, &write_buf, &write_buf_len,
+ APR_BLOCK_READ)) != APR_SUCCESS) {
+@@ -401,6 +404,9 @@
+ return rv;
+ }
+
++ APR_BUCKET_REMOVE(bucket_request);
++ APR_BRIGADE_INSERT_TAIL(tmpbb, bucket_request);
++
+ /* Write the buffer to fastcgi server */
+ has_write = 0;
+ while (has_write < write_buf_len) {
+@@ -411,6 +417,7 @@
+ write_buf_len - has_write,
+ &byteswrite, &handle_info->overlap_write)) {
+ has_write += byteswrite;
++ apr_brigade_cleanup(tmpbb);
+ continue;
+ } else if ((rv = GetLastError()) != ERROR_IO_PENDING) {
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING,
+@@ -437,6 +444,7 @@
+ return APR_ESPIPE;
+ }
+ has_write += transferred;
++ apr_brigade_cleanup(tmpbb);
+ continue;
+ } else {
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0,
+@@ -448,6 +456,7 @@
+ }
+ }
+
++ apr_brigade_destroy(tmpbb);
+ return APR_SUCCESS;
+ }
+
+--- modules/fcgid/fcgid_proc_unix.c 2015-08-28 13:39:44.614914500 +0200
++++ modules/fcgid/fcgid_proc_unix.c 2015-08-28 13:39:44.724299600 +0200
+@@ -762,14 +762,16 @@
+ struct iovec vec[FCGID_VEC_COUNT];
+ int nvec = 0;
+ apr_bucket *e;
++ apr_bucket_brigade* tmpbb = apr_brigade_create(output_brigade->p,output_brigade->bucket_alloc);
++
++ while (!APR_BRIGADE_EMPTY(output_brigade)) {
++ e = APR_BRIGADE_FIRST(output_brigade);
+
+- for (e = APR_BRIGADE_FIRST(output_brigade);
+- e != APR_BRIGADE_SENTINEL(output_brigade);
+- e = APR_BUCKET_NEXT(e)) {
+ apr_size_t len;
+ const char* base;
+
+ if (APR_BUCKET_IS_METADATA(e)) {
++ apr_bucket_delete(e);
+ continue;
+ }
+
+@@ -780,6 +782,9 @@
+ return rv;
+ }
+
++ APR_BUCKET_REMOVE(e);
++ APR_BRIGADE_INSERT_TAIL(tmpbb, e);
++
+ vec[nvec].iov_len = len;
+ vec[nvec].iov_base = (char*) base;
+ if (nvec == (FCGID_VEC_COUNT - 1)) {
+@@ -789,6 +794,7 @@
+ FCGID_VEC_COUNT)) != APR_SUCCESS)
+ return rv;
+ nvec = 0;
++ apr_brigade_cleanup(tmpbb);
+ }
+ else
+ nvec++;
+@@ -800,6 +806,7 @@
+ return rv;
+ }
+
++ apr_brigade_destroy(tmpbb);
+ return APR_SUCCESS;
+ }
+