1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-16 20:22:08 +03:00

979 Commits

Author SHA1 Message Date
Joe Orton
ffeacdcc52 Fix typo in code comments; dependancies -> dependencies
Submitted by: John Bampton <jbampton gmail.com>
Github: closes #520


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924446 13f79535-47bb-0310-9956-ffa450edef68
2025-03-18 09:54:15 +00:00
Ruediger Pluem
fbe782e6c4 * Follow up to r1918814: Strings are from configuration and thus trusted
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918823 13f79535-47bb-0310-9956-ffa450edef68
2024-07-02 11:19:45 +00:00
Ruediger Pluem
aa4b05ee05 * Always trust content types that we set literally
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918814 13f79535-47bb-0310-9956-ffa450edef68
2024-07-02 06:35:53 +00:00
Yann Ylavic
9ef9e5a80e mod_crypto: Fix warnings about signed bit fields.
The non-zero value for one bit field is -1:

mod_crypto.c|565 col 18| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
||     ctx->encrypt = 1;
||                  ^ ~
mod_crypto.c|746 col 22| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
||         ctx->clength = 1;
||                      ^ ~
mod_crypto.c|903 col 35| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
||                     ctx->seen_eos = 1;
||                                   ^ ~
mod_crypto.c|960 col 22| error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
||         ctx->clength = 1;
||                      ^ ~

Use unsigned bit fields for struct crypto_ctx's members seen_eos, encrypt and clength.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916299 13f79535-47bb-0310-9956-ffa450edef68
2024-03-14 14:54:59 +00:00
Joe Orton
a046be0dac * modules/filters/mod_xml2enc.c (xml2enc_ffunc): Accept any XML media
type per RFC 7303, plus any text/ type.

PR: 64339
Github: closes #409


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915625 13f79535-47bb-0310-9956-ffa450edef68
2024-02-07 15:26:27 +00:00
Joe Orton
4889f667f8 mod_deflate: remove filter after seeing EOS
Submitted by: Eric Norris <enorris etsy.com>
Github: closes #387


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914800 13f79535-47bb-0310-9956-ffa450edef68
2023-12-20 13:07:40 +00:00
Eric Covener
27a68e54b7 mod_xml2enc: remove dependency on xmlstring header
Submitted by: ttachi <tachihara@hotmail.com>

Github: closes #393


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914013 13f79535-47bb-0310-9956-ffa450edef68
2023-11-21 12:58:47 +00:00
Giovanni Bechis
51e28dcdec fix return codes
spotted by Yann Ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910304 13f79535-47bb-0310-9956-ffa450edef68
2023-06-08 09:24:21 +00:00
Giovanni Bechis
e466de0c0c mod_ext_filter: check exit status of filter processes
Whenever a filter process returns a non-zero exit status, or is killed
by a signal, return a HTTP 500 error, and log the reason.
Ran top-level make update-log-msg-tags to update APLOGNO numbers.

Submitted by: Dimitry Andric <dimitry@unified-streaming.com>

Github: closes #296


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910267 13f79535-47bb-0310-9956-ffa450edef68
2023-06-06 22:02:37 +00:00
Eric Covener
65b8fb947b limit mod_sed memory use
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1901506 13f79535-47bb-0310-9956-ffa450edef68
2022-06-01 12:40:09 +00:00
Ruediger Pluem
499a90a672 * Use apr_size_t instead of int to avoid an overflow
PR: 66034


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900307 13f79535-47bb-0310-9956-ffa450edef68
2022-04-27 06:43:11 +00:00
Ruediger Pluem
e06b6b0f24 * Improve the logic flow
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898735 13f79535-47bb-0310-9956-ffa450edef68
2022-03-08 15:41:55 +00:00
Yann Ylavic
8926bb1dc4 mod_sed: use size_t to allow for larger buffer sizes and unsigned arithmetics.
Let's switch to apr_size_t buffers and get rid of the ints.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898690 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 14:16:22 +00:00
Yann Ylavic
4145dfbd86 mod_reqtimeout: Set socket timeout for AP_MODE_INIT.
If the SSL handshake is initiated by ssl_hook_process_connection() in
AP_MODE_INIT mode, we still want to adapt the socket timeout according
to the time left for the handshake.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897422 13f79535-47bb-0310-9956-ffa450edef68
2022-01-24 16:08:14 +00:00
Christophe Jaillet
d600757e52 SEDERR_TMAMES and SEDERR_TMRMES are used only in sed1.c with 'eval->lnum' as an argument.
'eval' is of type 'struct sed_eval_s' and 'lnum' is an apr_int64_t.

So use APR_INT64_T_FMT format specifier to be more consistent.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897271 13f79535-47bb-0310-9956-ffa450edef68
2022-01-20 21:28:17 +00:00
Christophe Jaillet
84aceb715b The format specifier is APR_SIZE_T_FMT, so there is no point in trying to log -1 if apr_file_read() fails, because size_t is unsigned.
It is more straighforward to log the real value returned by apr_file_read() in such a case. The error code is also logged anyway.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897270 13f79535-47bb-0310-9956-ffa450edef68
2022-01-20 21:22:04 +00:00
Joe Orton
6aef687d93 * modules/filters/mod_deflate.c (deflate_in_filter): Handle FLUSH in
the input brigade even if done inflating (ctx->done is true), but
  don't try to flush the inflate stream in that case.  (Caught by
  Coverity)

Github: closes #280


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895552 13f79535-47bb-0310-9956-ffa450edef68
2021-12-03 13:07:42 +00:00
Joe Orton
c1a2dfc908 * modules/filters/mod_deflate.c (deflate_out_filter): Catch
apr_bucket_read() errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894152 13f79535-47bb-0310-9956-ffa450edef68
2021-10-12 08:27:15 +00:00
Stefan Eissing
0fd0275c18 * mod_deflate: refrain from reading buckets of known length, just
to get their length. This may transform buckets unwanted (e.g. file
   to mmap) and prevent optimization down the filter chain.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892728 13f79535-47bb-0310-9956-ffa450edef68
2021-08-30 10:05:06 +00:00
Christophe Jaillet
9a7434eb75 Fix a comment (missing '_' in 'keep_body')
While at it, fix some space related style issues  and a doxygen like comment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1889327 13f79535-47bb-0310-9956-ffa450edef68
2021-04-30 12:40:54 +00:00
Stefan Eissing
587d170151 *) core: provide ap_ssl_* functions in new http_ssl.h header file.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1888083 13f79535-47bb-0310-9956-ffa450edef68
2021-03-26 11:27:34 +00:00
Stefan Eissing
7c5e4c9ab2 Using the new ap_ssl_conn_is_ssl() and ap_ssl_var_lookup() in all internal modules.
* leaving mod_nw_ssl and mod_ssl itself untouched
 * removing mod_ssl.h includes where no longer necessary
 * some modules might skip post_config hooks, but those were left in, even when empty now.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887364 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 12:55:55 +00:00
Joe Orton
caeb908164 The Microsoft OOXML format uses xml packaged into a zip file, and has
mimetypes like:

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

This mimetypes contains 'xml', but is unfortunately not an xml file.

xml2enc processes these files (in particular, when mod_proxy_html is
used), typically resulting in them being corrupted as it seems to
attempt to perform a ISO-8859-1 to UTF-8 conversion on them.

* modules/filters/mod_xml2enc.c (xml2enc_ffunc): Restrict test for XML
  types to matching "+xml".

Submitted by: Joseph Heenan <joseph.heenan fintechlabs.io>
PR: 64339
Github: closes #150


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884505 13f79535-47bb-0310-9956-ffa450edef68
2020-12-16 16:23:23 +00:00
Nick Kew
5a64355b3f PR#64443: watch whether mod_proxy_html i18n might risk messing up FORM
submission, and insert accept-charset attribute if necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878553 13f79535-47bb-0310-9956-ffa450edef68
2020-06-06 22:54:32 +00:00
Christophe Jaillet
c9ff845120 Move stray /i switch into proper location
This has only been  applied to 2.4.x in r1537823 and never reached trunk

[skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878055 13f79535-47bb-0310-9956-ffa450edef68
2020-05-23 11:13:48 +00:00
Yann Ylavic
11d03dc86a core,modules: provide/use ap_parse_strict_length() helper.
It helps simplifying a lot of duplicated code based on apr_strtoff(), while
also rejecting leading plus/minus signs which are dissalowed in Content-Length
and (Content-)Range headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877954 13f79535-47bb-0310-9956-ffa450edef68
2020-05-20 14:01:17 +00:00
Joe Orton
7cd29dcbb5 * modules/filters/mod_proxy_html.c: Fix proxy_html_conf.bufsz
to have correct type, as it is used with ap_set_int_slot.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876823 13f79535-47bb-0310-9956-ffa450edef68
2020-04-22 11:25:40 +00:00
Yann Ylavic
f461bcf12c Add missing pool tags to help debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 12:32:33 +00:00
Jean-Frederic Clere
c643bc9810 PR64295 cannot override default Virtualhost's mod_reqtimeout
of course only body=n can work the headers have to parsed to get the virtualhost.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876540 13f79535-47bb-0310-9956-ffa450edef68
2020-04-15 08:51:05 +00:00
Giovanni Bechis
eac9bcb41a "?:" is a GNU extension, use standard syntax
spotted by Christophe Jaillet


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874558 13f79535-47bb-0310-9956-ffa450edef68
2020-02-27 06:59:10 +00:00
Giovanni Bechis
46e908f1dc Avoid printing NULL strings in logs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874545 13f79535-47bb-0310-9956-ffa450edef68
2020-02-26 17:47:53 +00:00
Giovanni Bechis
2766f07d41 Avoid printing NULL strings in logs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874346 13f79535-47bb-0310-9956-ffa450edef68
2020-02-22 00:14:49 +00:00
Giovanni Bechis
f71e6fc9a3 convert malloc(3) into ap_malloc
bz 64049


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874156 13f79535-47bb-0310-9956-ffa450edef68
2020-02-18 07:37:45 +00:00
Yann Ylavic
c8f486d716 Follow up to r1873941: define AP_REG_NO_DEFAULT for raw ap_regcomp() usage.
This avoids having to define AP_REG_NO_* for each APR_REG_* specific option,
thus replacing AP_REG_NO_DOTALL introduced lately.

For ap_rxplus_compile() and mod_substitute where default AP_REG_DOTALL is not
suitable, let's use:
    AP_REG_NO_DEFAULT | ap_regcomp_get_default_cflags() & AP_REG_DOLLAR_ENDONLY
to keep the default AP_REG_DOLLAR_ENDONLY unless RegexDefaultOptions unsets it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874090 13f79535-47bb-0310-9956-ffa450edef68
2020-02-16 23:08:32 +00:00
Mike Rumph
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
Eric Covener
b6dd2f55dc don't use DOTALL from mod_substitute which leaves \n at the end of the line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873941 13f79535-47bb-0310-9956-ffa450edef68
2020-02-12 13:36:40 +00:00
Christophe Jaillet
03d334ebe0 Honor "Accept-Encoding: foo;q=0" as per RFC 7231; which means 'foo' is "not acceptable". PR 58158
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868313 13f79535-47bb-0310-9956-ffa450edef68
2019-10-11 20:21:14 +00:00
Jim Jagielski
cfa53dbc94 Reverse the order of the test... if clang, then use clang, because some clangs also represent as GNUC.
This fixes breaking the macOS builds due to r1864435 under maint-mode


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867183 13f79535-47bb-0310-9956-ffa450edef68
2019-09-19 15:50:43 +00:00
Joe Orton
963c1c8fac * modules/filters/mod_proxy_html.c, modules/filters/mod_xml2enc.c:
Fix gcc 9 warnings in code attempting to reduce gcc warnings.
  (should have used expat...)

mod_xml2enc.c:26:28: warning: "/*" within comment [-Wcomment]
   26 | /* libxml2 includes unicode/*.h files which uses C++ comments */
      |                             
mod_proxy_html.c:32:28: warning: "/*" within comment [-Wcomment]
   32 | /* libxml2 includes unicode/*.h files which uses C++ comments */
      |                             


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864464 13f79535-47bb-0310-9956-ffa450edef68
2019-08-06 07:54:24 +00:00
Rainer Jung
a7eadc31c9 Unfortunately -Wcomment can only be influenced
using a diagnostics pragma starting with GCC 4.6.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864451 13f79535-47bb-0310-9956-ffa450edef68
2019-08-05 18:31:35 +00:00
Rainer Jung
5174cd78c1 Follow up to r1864438 and r1864435:
Use the right pragma syntax also in the second file.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864450 13f79535-47bb-0310-9956-ffa450edef68
2019-08-05 18:05:12 +00:00
Rainer Jung
dd21b36dbd Use the right pragma syntax.
Follow-up to r1864435.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864438 13f79535-47bb-0310-9956-ffa450edef68
2019-08-05 14:28:41 +00:00
Rainer Jung
40581b9391 The GCC flag "-Wno-error=comment" introduced by r1855446
and r1850745 are only known since GCC 4.2. Since it gets
set unconditionally, this breaks compilation with old GCC
even when not using maintainer mode.

Make the fix for maintainer mode more specific by using
a version dependent pragma in the relevant two C files
only switching off error status for comment warnings.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864435 13f79535-47bb-0310-9956-ffa450edef68
2019-08-05 14:18:22 +00:00
Graham Leggett
cd58f1856a After reinstatement of DSO support in APR/APR-util, revert r1837437,
r1837435, r1834553, r1833598, r1833452, r1833383, r1833368.

Undoes the following:

mod_ssl: OpenSSL now initializes fully through APR, use that.

mod_ssl: build with LibreSSL.

LibreSSL seems to be openssl-1.1 API compatible only in version 2.8 (master).
So use that for MODSSL_USE_OPENSSL_PRE_1_1_API instead of 2.7, the two 2.7
compatibility-exceptions are handled explicitely but overall it's simpler.

Regarding CRYPTO_malloc_init vs OPENSSL_malloc_init, libreSSL uses none, the
former used to be a no-op but depends is LIBRESSL_INTERNAL in latest versions,
while the latter has never been (and will never be) defined. So don't call any
with LibreSSL.

Follow up to r1833368: share openssl between modules.

Both libapr[-util], the core PRNG, mod_ssl, mod_crypto and mod_session_crypto
can use the same crypto library (e.g. openssl), use the new APR crypto loading
API so that they can work together and initialize/terminate the lib either once
for all or on demand and reusable by the others.

Follow up to r1833368: apr_crypto_prng_after_fork() now used a PID.

Make use of the new apr_crypto_rng API if available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1861947 13f79535-47bb-0310-9956-ffa450edef68
2019-06-23 21:10:23 +00:00
Yann Ylavic
91f1ba4263 mod_reqtimeout: fix default_[stage]_rate_factor initializations.
r1853901 lowercased the [stage] for MRT_DEFAULT_[stage]_* macros but missed
to change the ones used in reqtimeout_hooks() to initialize the default rate
factors, leading to no default rate in 2.4.39. Fix that now. PR 63325.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1857129 13f79535-47bb-0310-9956-ffa450edef68
2019-04-08 18:46:12 +00:00
Jim Jagielski
b444a8e579 Make the work-around for C++ style comments causing fatal errors in
maintainer-mode for later versions of clang module compile specific
(we will still SEE the errors though when buidlin)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855446 13f79535-47bb-0310-9956-ffa450edef68
2019-03-13 17:56:36 +00:00
Yann Ylavic
33bba0cb96 mod_reqtimeout: follow up to r1853901: init stage name outside INIT_STAGE().
It helps both code readability where stages are initilized and potential
logging in the input filter (even if the stage is disabled).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853935 13f79535-47bb-0310-9956-ffa450edef68
2019-02-20 08:54:51 +00:00
Yann Ylavic
5160a03ef8 mod_reqtimeout: follow up to r1853901: fix macro args.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853929 13f79535-47bb-0310-9956-ffa450edef68
2019-02-20 08:13:41 +00:00
Yann Ylavic
94d9347fca mod_reqtimeout: follow up to r1853906: adjust hooks priorities comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853908 13f79535-47bb-0310-9956-ffa450edef68
2019-02-19 18:22:11 +00:00
Yann Ylavic
1416730b40 mod_reqtimeout: Allow to configure (TLS-)handshake timeouts.
The timeouts apply between the process_connection and pre_read_request hooks.
They are disabled by default for compatibily reasons.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853906 13f79535-47bb-0310-9956-ffa450edef68
2019-02-19 18:14:13 +00:00