From 028e2520f0997de1e65df2ff826009f9d8b16953 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 20:29:04 +0100 Subject: [PATCH] rebuilt with patches [release 2.3.9-2mamba;Tue Oct 24 2023] --- apache-mod_fcgid-2.3.9-fix-bts-691929.patch | 67 +++++++++++ ...he-mod_fcgid-2.3.9-large-file-upload.patch | 112 ++++++++++++++++++ apache-mod_fcgid.spec | 14 ++- 3 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 apache-mod_fcgid-2.3.9-fix-bts-691929.patch create mode 100644 apache-mod_fcgid-2.3.9-large-file-upload.patch diff --git a/apache-mod_fcgid-2.3.9-fix-bts-691929.patch b/apache-mod_fcgid-2.3.9-fix-bts-691929.patch new file mode 100644 index 0000000..80b1053 --- /dev/null +++ b/apache-mod_fcgid-2.3.9-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/apache-mod_fcgid-2.3.9-large-file-upload.patch b/apache-mod_fcgid-2.3.9-large-file-upload.patch new file mode 100644 index 0000000..55f5ddc --- /dev/null +++ b/apache-mod_fcgid-2.3.9-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; + } + diff --git a/apache-mod_fcgid.spec b/apache-mod_fcgid.spec index 0ed8e49..b892b85 100644 --- a/apache-mod_fcgid.spec +++ b/apache-mod_fcgid.spec @@ -1,20 +1,21 @@ Name: apache-mod_fcgid Version: 2.3.9 -Release: 1mamba +Release: 2mamba Summary: A high performance alternative to mod_cgi or mod_cgid Group: System/Servers Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco -URL: http://httpd.apache.org/mod_fcgid/ +URL: https://httpd.apache.org/mod_fcgid/ Source: http://apache.panu.it//httpd/mod_fcgid/mod_fcgid-%{version}.tar.bz2 +Patch0: apache-mod_fcgid-2.3.9-fix-bts-691929.patch +Patch1: apache-mod_fcgid-2.3.9-large-file-upload.patch License: Apache License 2.0 ## AUTOBUILDREQ-BEGIN -## note: run 'autospec -u -a6 apache-mod_fcgid' to get the list of build requirements. +BuildRequires: glibc-devel ## AUTOBUILDREQ-END BuildRequires: apache >= 2.4 Requires: apache >= 2.4 -BuildRoot: %{_tmppath}/%{name}-%{version}-root %description mod_fcgid is a high performance alternative to mod_cgi or mod_cgid, which starts a sufficient number instances of the CGI program to handle concurrent requests, and these programs remain running to handle further incoming requests. It is favored by the PHP developers, for example, as a preferred alternative to running mod_php in-process, delivering very similar performance. @@ -23,6 +24,8 @@ mod_fcgid is a high performance alternative to mod_cgi or mod_cgid, which starts %prep %setup -q -n mod_fcgid-%{version} +%patch 0 -p1 -b .fix-bts-691929 +%patch 1 -p0 -b .large-file-upload %build ./configure.apxs @@ -57,5 +60,8 @@ fi %doc README-FCGID %changelog +* Tue Oct 24 2023 Silvan Calarco 2.3.9-2mamba +- rebuilt with patches + * Thu Sep 04 2014 Silvan Calarco 2.3.9-1mamba - package created using the webbuild interface