From f87a44bed77e2fa4120cfd013362f27ee201aabc Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 11:03:55 +0000 Subject: import mod_fcgid-2.3.9-6.el7 --- diff --git a/SOURCES/mod_fcgid-2.3.9-r1848298.patch b/SOURCES/mod_fcgid-2.3.9-r1848298.patch new file mode 100644 index 0000000..3f5dd93 --- /dev/null +++ b/SOURCES/mod_fcgid-2.3.9-r1848298.patch @@ -0,0 +1,87 @@ +# ./pullrev.sh 1848298 + +http://svn.apache.org/viewvc?view=revision&revision=1848298 + +https://bugzilla.redhat.com/show_bug.cgi?id=1652493 + +--- mod_fcgid-2.3.9/modules/fcgid/fcgid_bridge.c ++++ mod_fcgid-2.3.9/modules/fcgid/fcgid_bridge.c +@@ -526,7 +526,8 @@ + } + + static int add_request_body(request_rec *r, apr_pool_t *request_pool, +- apr_bucket_brigade *output_brigade) ++ apr_bucket_brigade *output_brigade, ++ apr_off_t *body_length) + { + apr_bucket *bucket_input, *bucket_header; + apr_file_t *fd = NULL; +@@ -729,22 +730,49 @@ + } + APR_BRIGADE_INSERT_TAIL(output_brigade, bucket_header); + ++ *body_length = request_size; ++ + return 0; + } + + int bridge_request(request_rec * r, int role, fcgid_cmd_conf *cmd_conf) + { +- apr_bucket_brigade *output_brigade; ++ apr_bucket_brigade *output_brigade, *body_brigade; + apr_bucket *bucket_eos; +- char **envp = ap_create_environment(r->pool, +- r->subprocess_env); ++ char **envp; + int rc; + + /* Create brigade for the request to fastcgi server */ ++ body_brigade ++ = apr_brigade_create(r->pool, r->connection->bucket_alloc); + output_brigade = + apr_brigade_create(r->pool, r->connection->bucket_alloc); + +- /* Build the begin request and environ request, append them to output_brigade */ ++ /* In responder mode, handle the request body up front to ensure ++ * the content-length is known (even if the request body is ++ * chunked) and sent in the header. */ ++ if (role == FCGI_RESPONDER) { ++ apr_off_t body_length; ++ ++ rc = add_request_body(r, r->pool, body_brigade, &body_length); ++ if (rc) { ++ return rc; ++ } ++ ++ if (body_length && !apr_table_get(r->headers_in, "Content-Length")) { ++ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, ++ "mod_fcgid: dechunked request body length %" APR_OFF_T_FMT, ++ body_length); ++ ++ apr_table_set(r->subprocess_env, "CONTENT_LENGTH", ++ apr_off_t_toa(r->pool, body_length)); ++ apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING"); ++ } ++ } ++ ++ envp = ap_create_environment(r->pool, r->subprocess_env); ++ ++ /* Build the begin request and environ request, add them to output_brigade */ + if (!build_begin_block + (role, r, r->connection->bucket_alloc, output_brigade) + || !build_env_block(r, envp, r->connection->bucket_alloc, +@@ -754,12 +782,8 @@ + return HTTP_INTERNAL_SERVER_ERROR; + } + +- if (role == FCGI_RESPONDER) { +- rc = add_request_body(r, r->pool, output_brigade); +- if (rc) { +- return rc; +- } +- } ++ /* Append the body output. */ ++ APR_BRIGADE_CONCAT(output_brigade, body_brigade); + + /* The eos bucket now */ + bucket_eos = apr_bucket_eos_create(r->connection->bucket_alloc); diff --git a/SPECS/mod_fcgid.spec b/SPECS/mod_fcgid.spec index ec45674..d8da036 100644 --- a/SPECS/mod_fcgid.spec +++ b/SPECS/mod_fcgid.spec @@ -34,7 +34,7 @@ Name: mod_fcgid Version: 2.3.9 -Release: 4%{?dist}.1 +Release: 6%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -50,6 +50,7 @@ Source11: fastcgi-2.5.te Source12: fastcgi.fc Patch0: mod_fcgid-2.3.4-fixconf-shellbang.patch Patch1: mod_fcgid-2.3.9-segfault-upload.patch +Patch2: mod_fcgid-2.3.9-r1848298.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildRequires: httpd-devel >= 2.0, pkgconfig Requires: httpd-mmn = %{_httpd_mmn} @@ -120,6 +121,7 @@ cp -p %{SOURCE12} fastcgi.fc # Fix shellbang in fixconf script for our location of sed %patch0 -p1 %patch1 -p1 -b .segfault_upload +%patch2 -p1 -b .r1848298 %build APXS=%{_httpd_apxs} ./configure.apxs @@ -223,8 +225,11 @@ exit 0 %endif %changelog -* Mon Oct 16 2017 Luboš Uhliarik - 2.3.9-4.1 -- Resolves: #1501307 - mod_fcgid cause Segmentation fault error while doing +* Thu Dec 6 2018 Joe Orton - 2.3.9-6 +- fix handling of chunked request bodies (#1652493) + +* Mon Sep 04 2017 Luboš Uhliarik - 2.3.9-5 +- Resolves: #1486653 - mod_fcgid cause Segmentation fault error while doing large file uploads over HTTPS * Fri Jan 24 2014 Daniel Mach - 2.3.9-4