1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

376 Commits

Author SHA1 Message Date
Jim Jagielski
4f192db406 mpm_motorz: give secondary connections their own conn_state_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939366 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 19:20:13 +00:00
Jim Jagielski
79af052c10 mpm_motorz: drain connections on graceful stop, add ServerLimit, fix spawning
A child asked to stop gracefully (AP_SIG_GRACEFUL, the pipe-of-death, a
generation change or MaxConnectionsPerChild) used to set die_now, which
stopped the pollers and cancelled everything still queued in the worker
pool.  Connections writing a response, parked keep-alive connections and
accepted connections not yet started were dropped, so a slow download
was truncated by any graceful restart.

The child now drains.  The supervisor starts it, the listener-owning
poller closes the listening sockets from its own thread, idle keep-alive
connections are expired at once, and the child exits when the count of
open connections reaches zero.  The parent no longer counts a draining
child, so its replacement starts in a free slot while the old one
finishes.  Run child_stopping and child_stopped from the child exit path
as the other MPMs do.

The scoreboard is sized from the daemon limit when first created and is
kept across graceful restarts, but motorz reported StartServers as that
limit, so raising StartServers on a graceful restart indexed past the
end of shared memory and crashed the parent.  Add ServerLimit, defaulting
to twice StartServers, and fix it and ThreadLimit across restarts as
mpm_event does.

perform_idle_server_maintenance() could fork into slot 0 when no slot
was free, and did not count a child that was still starting.  Count
children by recorded pid, generation and quiescing state instead, and
start one only in a free slot.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939361 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 18:34:41 +00:00
Jim Jagielski
84cc989600 mod_proxy_hcheck: fix several health check problems (truncated responses, SNI, limits, probe URI)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939353 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 16:05:54 +00:00
Jim Jagielski
55f5db10ee mod_proxy: update the shared worker status atomically in ap_proxy_set_wstatus()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939352 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 16:05:30 +00:00
Jim Jagielski
d86f3d11d9 mod_proxy: add a worker status bit for mod_proxy_beacon members
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939350 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 15:02:44 +00:00
Jim Jagielski
e2954b284d mod_proxy: don't leave a half-built worker if ap_proxy_define_worker() fails
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939349 13f79535-47bb-0310-9956-ffa450edef68
2026-10-23 15:02:17 +00:00
Arturo Bernal
5e3efd75a1 core: Propagate make_sock() failures when duplicating listeners
ap_duplicate_listeners() ignored the return value of make_sock() for a
duplicated listener. On failure make_sock() logs the error and closes
the socket, but the loop carried on with the closed listener: with one
Listen the server started or restarted with fewer listeners, and with
several it failed on the closed descriptor with a misleading "Bad file
descriptor". Return the error so that the MPM reports "could not
duplicate listeners" with the original status.

PR: 70106
Submitted by: Xuqing Yang
GitHub: closes #861


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939304 13f79535-47bb-0310-9956-ffa450edef68
2026-10-21 05:12:42 +00:00
Arturo Bernal
7e6d305c8a mod_md: Fix a one-second race in md_asn1_time_get().
* modules/md/md_crypt.c (md_asn1_time_get): For OpenSSL >= 1.1.1,
  convert the certificate's ASN1_TIME directly via ASN1_TIME_to_tm()
  instead of reconstructing it as apr_time_now() + ASN1_TIME_diff().
  The latter samples the current time twice (once explicitly, once
  inside ASN1_TIME_diff()); if the wall clock ticks over a second
  between the two reads, the result is off by one second. This is a
  real, reproducible race, not a theoretical one: forcing the two
  reads to straddle a second boundary reproduces it in 29-39 out of
  40 trials. It intermittently broke the exact-timestamp assertions
  in test/modules/md/test_920_status.py::test_md_920_002.

* changes-entries/md-asn1-time-race.txt: Add entry.

GitHub: closes #838


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939271 13f79535-47bb-0310-9956-ffa450edef68
2026-10-19 14:17:35 +00:00
Arturo Bernal
23104ca014 mod_negotiation: Do not send the qs parameter in the Content-Type.
A MultiViews response took the media type of the selected file as it
was, so the qs source quality set with AddType was sent to the client.
Drop it after the variant has been selected. Other parameters are kept.

PR: 53595
GitHub: closes #824


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939268 13f79535-47bb-0310-9956-ffa450edef68
2026-10-19 10:12:12 +00:00
Joe Orton
54cc53eb4b mod_autoindex: fix one-byte over-read past end of description
Stop reading (and writing) one byte past the end of a file
description when it ends inside an unterminated "&" entity or "<"
tag, as a ScanHTMLTitles title can.

* modules/generators/mod_autoindex.c (terminate_description): Check
  for the terminating NUL before advancing past it when scanning an
  unterminated "<" tag or "&" entity, and break out of the loop at
  end of string rather than continuing past it.

* test/modules/generators/env.py (GeneratorsTestSetup.__init__): Load
  mod_autoindex for the generators test suite.

* test/modules/generators/htdocs/autoindex/: New test content.

* test/modules/generators/test_002_autoindex.py (TestAutoindex): New
  test that a ScanHTMLTitles description ending in a bare "&" is
  rendered without reading past the end of the description.

Submitted by: arshiya tabasum <arshi bugqore.com>
GitHub: closes #812


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939181 13f79535-47bb-0310-9956-ffa450edef68
2026-10-17 11:18:52 +00:00
Joe Orton
e3a8b4e1e6 mod_cgid: Raise the limit on the number of environment variables passed
to a script from 256 to APACHE_ARG_MAX, and bound URI/query/env-value
lengths against the configured request limits rather than APR_PATH_MAX.
PR 70270.

* changes-entries/cgid-env-limit.txt: Add changelog entry.

* modules/generators/mod_cgid.c: Replace ENV_COUNT_MAX with ENV_VAL_MAX,
  a sanity bound on the length of a single environment variable value.
  (get_req): Take the main server_rec as an argument.  Allow up to
  APACHE_ARG_MAX environment variables; check uri_len and args_len
  against the configured LimitRequestLine rather than APR_PATH_MAX;
  check each environment variable value against ENV_VAL_MAX.
  (send_req): Fail with APR_ENOSPC if more than APACHE_ARG_MAX
  environment variables are present.
  (cgid_server): Pass main_server to get_req.

* test/modules/generators/htdocs/cgi/: New tests scripts.

* test/modules/generators/test_001_cgid.py: New tests.

Submitted by: Emmanuel Dreyfus <manu netbsd.org>, jorton
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: closes #850


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939165 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 18:55:52 +00:00
Arturo Bernal
3c8bb1b370 mod_http2: Send HTTP/2 error codes in GOAWAY frames
h2_session_shutdown() passed its reason, an APR or nghttp2 status, as the
error code of the GOAWAY frame. A connection timeout was sent as 70007
(APR_TIMEUP), an inadequate TLS connection as 22 (APR_EINVAL).

Give h2_session_shutdown() the HTTP/2 error code as a separate argument.
Timeouts and graceful shutdowns send NO_ERROR, failures INTERNAL_ERROR
and inadequate TLS parameters INADEQUATE_SECURITY.

PR: 70212
GitHub: closes #799


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939156 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 14:41:25 +00:00
Arturo Bernal
261058fa22 mod_dav: Do not advertise disabled TRACE
dav_method_options() builds its own Allow field and unconditionally
advertised TRACE for existing DAV resources, even when TraceEnable was
off.

Respect TraceEnable when constructing the DAV Allow field.

PR: 70264
GitHub: closes #827


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939146 13f79535-47bb-0310-9956-ffa450edef68
2026-10-16 09:01:44 +00:00
Arturo Bernal
ba3fa29664 core: Add common apr_off_t config parser
Add ap_size_parameter_parse(), a helper to parse a configuration value
as an apr_off_t, which fails on trailing characters and on overflow.
The range of the value remains up to the directive.

Use it for configuration directives which parsed such values in
different ways, some of them accepting trailing characters or doing no
checks at all: LimitRequestBody (unchanged behavior), ScriptLogLength,
ScriptLogBuffer, DavQuota, BufferSize, AuthFormSize, and the
mod_cache_disk and mod_cache_socache size and time directives.

GitHub: closes #829


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939129 13f79535-47bb-0310-9956-ffa450edef68
2026-10-15 03:41:47 +00:00
Joe Orton
b2dc966be4 mod_deflate: Fix sign extension when reading the gzip extra-field length.
* changes-entries/deflate-xlen-unsigned.txt: Add changes entry.

* modules/filters/mod_deflate.c (consume_zlib_flags): Cast the
  FEXTRA length bytes through unsigned char before widening so a
  byte with the high bit set is not sign-extended, fixing inflation
  of gzip streams carrying an extra field.

Submitted by: arshiya tabasum <arshi bugqore.com>
GitHub: closes #839


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939124 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 20:32:49 +00:00
Arturo Bernal
c1b7c82f7e core: Reject invalid values of LimitXMLRequestBody.
set_limit_xml_req_body() used atol(), so "abc123" and "123abc" were
accepted as 0 and 123, and a value out of range of a long gave an
undefined result. Parse the whole argument with apr_strtoff() like
LimitRequestBody, and reject values that do not fit in limit_xml_body
or exceed AP_MAX_LIMIT_XML_BODY.

PR: 69975
GitHub: closes #825


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939121 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 17:07:23 +00:00
Eric Covener
21637138c4 changes-entry for r1939088
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939105 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 00:22:20 +00:00
Eric Covener
c42c5bba35 add a changes-entry template
consistency and we could use a dummy file in 2.4.x
so changes-entries/ is not dropped by git every
time `make update-changes` empties it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939103 13f79535-47bb-0310-9956-ffa450edef68
2026-10-14 00:17:36 +00:00
Joe Orton
1d27502fb5 * test/modules/filters/test_003_sed.py (TestSed.configure): Check a
failing configuration with httpd -t, and return its stderr;
  apachectl_stderr is not set on Windows.
  (test_filters_003_32, test_filters_003_35, test_filters_003_38,
  test_filters_003_39, test_filters_003_40, test_filters_003_42,
  test_filters_003_44, test_filters_003_45, test_filters_003_46): Use it.

* changes-entries/sed-fixes.txt: Add entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub: closes #791


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938966 13f79535-47bb-0310-9956-ffa450edef68
2026-10-09 19:37:33 +00:00
Joe Orton
3f95bd3fe6 mod_remoteip: PROXY protocol: handle a peer going away before the header,
and test the LOCAL command.

* modules/metadata/mod_remoteip.c (remoteip_input_filter): Log EOF while
  reading the PROXY protocol header at info level, as the peer going away;
  other read errors are still logged as errors.  Skip metadata buckets
  rather than copying from them: the EOS bucket arriving before the EOF
  was passed to memcpy() as a NULL source.

* test/modules/metadata/test_004_remoteip.py (test_metadata_004_03,
  test_metadata_004_04, test_metadata_004_05, test_metadata_004_06): Test
  PROXY protocol v2 with the PROXY and LOCAL commands, with and without an
  address block, and a peer disconnecting after a partial header.

PR: 63893
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GitHub: closes #805


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938927 13f79535-47bb-0310-9956-ffa450edef68
2026-10-08 20:04:38 +00:00
Joe Orton
47717ee2e4 mod_remoteip: Apply RemoteIP{Trusted,Internal}ProxyList to the virtual host
they are configured in, and fix merging.

* modules/metadata/mod_remoteip.c
  (merge_remoteip_server_config): When both the main server and the virtual
  host have proxymatch_ip entries, merge the two arrays.
  (remoteip_hook_post_config): Log a warning (APLOGNO 10633) for each
  virtual host whose proxy entries were merged with the main server's.
  (remoteip_cmds): Drop EXEC_ON_READ from RemoteIPTrustedProxyList and
  RemoteIPInternalProxyList so the directives apply in the server/vhost
  scope they are configured in, rather than globally at config read time.

* test/modules/metadata/test_004_remoteip.py: New test.

* test/modules/metadata/env.py
  (MetadataTestSetup.__init__): Add remoteip to the optional modules.

PR: 70207
Submitted by: Arturo Bernal <abernal apache.org>
GitHub: closes #793


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938908 13f79535-47bb-0310-9956-ffa450edef68
2026-10-08 08:31:23 +00:00
Joe Orton
8dbd2836d0 mod_socache_redis: Fix the unit of the RedisTimeout passed to the Redis
client.

* modules/cache/mod_socache_redis.c
  (RD_DEFAULT_SERVER_RWTO): Define in seconds rather than microseconds.
  (socache_rd_set_timeout): Convert the timeout from apr_time_t to whole
  seconds, rounding up so a positive value does not become 0.

* test/modules/ssl/env.py
  (SSLTestSetup.__init__): Add socache_redis as an optional module.

* test/modules/ssl/test_004_socache_redis.py: New test using a silent
  Redis server to verify that RedisTimeout values are applied with the
  expected whole-second rounding.

Submitted by: Christophe JAILLET, Arturo Bernal <abernal apache.org>
GitHub: closes #790


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938833 13f79535-47bb-0310-9956-ffa450edef68
2026-10-06 20:16:47 +00:00
Joe Orton
235f9c7cde mod_http2: support the asterisk-form of OPTIONS requests.
* modules/http2/h2_stream.c (h2_stream_create_input): do not reject a
  ':path' of '*' with a ':scheme' present when the method is OPTIONS
  over http/https; pass the asterisk-form through as is.

* test/modules/http2/test_203_rfc9113.py (test_h2_203_03_options_asterisk,
  test_h2_203_04_invalid_path): Add tests.

Submitted by: Arturo Bernal <abernal apache.org>
PR: 70195
GitHub: closes #788


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938821 13f79535-47bb-0310-9956-ffa450edef68
2026-10-06 14:16:26 +00:00
Jason S. Lingohr
f2829b2bc6 Fix background transparency of the tar icon.
Submitted by: Jeffery To <jeffery.to gmail.com>
PR: 70238

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938558 13f79535-47bb-0310-9956-ffa450edef68
2026-09-27 02:12:11 +00:00
Joe Orton
837965fd1e mod_env: Add the SetEnvFromFile directive:
* modules/metadata/mod_env.c (add_env_module_vars_from_file): New.
  (env_module_cmds): Add SetEnvFromFile.

* docs/manual/mod/mod_env.xml: Document SetEnvFromFile.

* test/modules/metadata/env.py (MetadataTestSetup.__init__): Load
  mod_env and mod_include, and enable their logging.

* test/modules/metadata/test_002_setenvfromfile.py: New tests.

Submitted by: Cornel Isbiceanu <cisbiceanu adobe.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub: closes #750


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938506 13f79535-47bb-0310-9956-ffa450edef68
2026-09-24 20:55:45 +00:00
Joe Orton
1a0c1b2d79 * modules/ssl/ssl_engine_kernel.c (ssl_hook_Access_modern): Don't add
SSL_VERIFY_CLIENT_ONCE to the verify mode used for Post-Handshake
  Authentication.  OpenSSL refuses the request with SSL_R_INVALID_CONFIG
  when that flag is set and a certificate has already been received, so
  a per-directory SSLVerifyClient failed with 403 on a TLSv1.3 connection
  to a virtual host which had itself asked for a certificate.

Submitted by: Michael Kaufmann <mail michael-kaufmann.ch>
PR: 63096
GitHub: PR #770


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938504 13f79535-47bb-0310-9956-ffa450edef68
2026-09-24 20:31:54 +00:00
Joe Orton
ef867975f7 * modules/filters/sed1.c (command): Take the octal digits the LCOM
case writes off the unsigned byte value, not off a sign-extended
  char.

* changes-entries/sed-l-command.txt: Add.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub: PR #769


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938487 13f79535-47bb-0310-9956-ffa450edef68
2026-09-24 14:47:58 +00:00
Joe Orton
5936453b90 mod_sed: Don't drop the EOS when evaluation fails:
* modules/filters/mod_sed.c (sed_filter_ctxt): Add passed, evalerr.
  (keep_metadata): New.
  (append_bucket, sed_response_filter): Track whether anything has
  reached the next filter.
  (sed_response_filter): On a failed evaluation, pass the metadata on
  and go on doing so for the rest of the response, unless nothing has
  been written yet; carry metadata buckets other than EOS and FLUSH
  through rather than deleting them; don't take the first bucket of an
  empty brigade.

* changes-entries/sed-eos-on-error.txt: Add.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub: PR #769


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938485 13f79535-47bb-0310-9956-ffa450edef68
2026-09-24 14:46:53 +00:00
Joe Orton
7b93fd7027 mod_sed: fix out-of-bounds read when a y/// command has mismatched string lengths
* modules/filters/sed0.c (ycomp): Stop parsing after reporting
  SEDERR_TSNTSS when the destination string is shorter than the
  source string.  Previously the loop kept advancing tsp past the
  closing delimiter and past the NUL terminator of the command
  line, reading beyond the end of linebuf and eventually reporting
  a bogus "ending delimiter missing" error.

Submitted by: Ankit Prateek <ankit offbyquant.com>

* test/modules/filters/test_002_sed_ycomp.py: New test.  Check that
  y/// commands with unequal string lengths are rejected with the
  size-mismatch error rather than the delimiter error, in both
  directions, and that a well-formed y/// still compiles and the
  server starts.  Skipped on Windows, where "httpd -k start" is
  service control and fails before the configuration is read.

* test/modules/filters/env.py (FiltersTestSetup.__init__): Load
  mod_sed.
  (FiltersTestEnv.__init__): Add sed to the logged modules.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub: closes #766, closes #678


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938337 13f79535-47bb-0310-9956-ffa450edef68
2026-09-17 21:17:38 +00:00
Joe Orton
6340a316eb mod_http2: log request header limit violations only once per stream.
* modules/http2/h2_stream.c (h2_stream_add_header): Guard the AH10178,
  AH10180 and AH10181 log messages on stream->request_headers_failed
  rather than h2_stream_is_ready().
  (h2_stream_end_headers): Likewise for AH10230.

Submitted by: Michael Kaufmann <mail michael-kaufmann.ch>

* test/modules/http2/test_111_header_limit_log.py: New test, checking
  that AH10181 is logged exactly once for a request with many headers
  over LimitRequestFields.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub: closes #765, closes #666


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938328 13f79535-47bb-0310-9956-ffa450edef68
2026-09-17 19:12:18 +00:00
Joe Orton
8983e3a2ce * modules/filters/mod_substitute.c (do_pattmatch): Enforce max line
length on unmatched tail.  Account for the unmatched tail after a 
  successful substitution before emitting the result. This keeps 
  SubstituteMaxLineLength effective for flattened literal substitutions 
  and for both regular-expression paths.

Submitted by: Robert McConnell <robert mcc0nnell.org>
GitHub: closes #755

Add test coverage:

* test/modules/filters/__init__.py,
  test/modules/filters/conftest.py,
  test/modules/filters/env.py,
  test/modules/filters/test_001_substitute_maxlen.py: New test suite.

GitHub: closes #762
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938306 13f79535-47bb-0310-9956-ffa450edef68
2026-09-17 06:52:02 +00:00
Joe Orton
2fc5be40ba mod_mime_libmagic: New module, determining MIME types using libmagic(3):
* modules/metadata/mod_mime_libmagic.c: New file.

* modules/metadata/config.m4: Add mime_libmagic.

* .github/workflows/linux.yml: Install libmagic-dev.

* docs/manual/mod/mod_mime_libmagic.xml: New file.

* docs/manual/mod/allmodules.xml: Add mod_mime_libmagic.

* changes-entries/mime-libmagic.txt: New file.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GitHub: PR #752


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938247 13f79535-47bb-0310-9956-ffa450edef68
2026-09-15 12:30:46 +00:00
Joe Orton
246ae2739e core: Add ap_cstr_stripws() to strip trailing whitespace from a
NUL-terminated string in place, returning a pointer to the new
terminating NUL.

* include/httpd.h: Declare ap_cstr_stripws().

* server/util.c (ap_cstr_stripws): Implement it, handling the
  empty-string case safely.
  (ap_getline): Use it; adjust the returned length and memmove size
  accordingly.

* modules/http/byterange_filter.c, modules/mappers/mod_negotiation.c,
  modules/metadata/mod_cern_meta.c, modules/proxy/mod_proxy_hcheck.c,
  modules/proxy/mod_proxy_http.c, modules/proxy/mod_proxy_uwsgi.c,
  server/util_script.c: Replace open-coded trailing-whitespace
  stripping loops with ap_cstr_stripws(). This avoids the undefined
  behaviour of forming &value[strlen(value)-1], which points before
  the start of the string when the value is empty.

* modules/metadata/mod_cern_meta.c, server/util_script.c: Use
  apr_pstrmemdup() with the returned end pointer rather than
  apr_pstrdup().

* include/ap_mmn.h: Bump MMN minor.

* test/unit/util.c: Add ap_cstr_stripws() unit tests.

* test/modules/proxy/test_03_response.py,
  test/modules/proxy/test_05_uwsgi.py: Add tests for empty backend
  response header values.

Submitted by: Robert McConnell <robert mcc0nnell.org>, jorton
GitHub: closes #749
Assisted-By: Claude Opus 4.8 <noreply@anthropic.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938194 13f79535-47bb-0310-9956-ffa450edef68
2026-09-14 11:05:50 +00:00
Joe Orton
6926aa53b5 * modules/metadata/mod_mime_magic.c (rsl_strdup): Fix off-by-one which
included a trailing whitespace character in the copied string; simplify
  loop termination.
  (magic_rsl_to_request): Decline if the type is not of the form
  token/token; ignore an encoding which is not a valid token.
  (ascmagic): Don't append a note for content with escape sequences.

* test/modules/metadata/: New test suite.

* docs/log-message-tags/next-number: Bump.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GitHub: closes #751


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938070 13f79535-47bb-0310-9956-ffa450edef68
2026-09-10 06:24:37 +00:00
Joe Orton
6aa1bce467 mod_auth_digest: Keep Authentication-Info on error responses.
* modules/aaa/mod_auth_digest.c (add_auth_info): Add the
  (Proxy-)Authentication-Info header to err_headers_out, so a one-time
  nonce client gets its nextnonce after an error response rather than a
  stale re-challenge.
  (note_digest_auth_failure): Drop any (Proxy-)Authentication-Info when
  issuing a challenge, so a post-authentication 401 carries only the
  fresh nonce.

* test/modules/aaa/test_011_authinfo_errors.py: New tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GitHub: closes PR #739


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937888 13f79535-47bb-0310-9956-ffa450edef68
2026-09-04 21:09:48 +00:00
Joe Orton
8e3c9de728 * modules/aaa/mod_auth_digest.c: Raise the default AuthDigestShmemSize to
8192 bytes, holding around 140 clients.

* docs/manual/mod/mod_auth_digest.xml: Document the new default.

* test/modules/aaa/conftest.py, test/modules/aaa/test_008_onetime_nccheck.py:
  Pin AuthDigestShmemSize to the old size.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub: PR #730


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937712 13f79535-47bb-0310-9956-ffa450edef68
2026-09-01 10:18:47 +00:00
Joe Orton
06c0a97f62 mod_systemd: Implement watchdog support:
* modules/arch/unix/mod_systemd.c (watchdog_ping): New.
  (systemd_pre_config, systemd_post_config, systemd_monitor): Send the
  watchdog keep-alive, and warn (AH10621) if WatchdogSec is too short
  to be met.

* docs/manual/mod/mod_systemd.xml: Document watchdog support.

* test/modules/arch/linux/test_006_watchdog.py: New test suite.

* test/modules/arch/linux/env.py (ForegroundServer): New, running httpd
  in the foreground so $WATCHDOG_PID can name it.
  (TransientService): Take extra unit properties.

* test/modules/arch/linux/test_001_notify.py
  (test_systemd_001_09_watchdog): No longer xfail; use a WatchdogSec
  which does not draw AH10621.

* test/modules/arch/linux/README: Describe the watchdog tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub: closes #728


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937644 13f79535-47bb-0310-9956-ffa450edef68
2026-08-30 08:57:27 +00:00
Joe Orton
1c116fc738 mod_proxy_connect: Implement "AllowCONNECT None":
The "none" arg is documented somehow in r1932337, but not implemented.

* modules/proxy/mod_proxy_connect.c (connect_conf): Add "None".
  (set_allowed_ports): Accept "None"; reject combining it with ports in
  the same context.
  (merge_config): Special-case "None": it disallows all ports and
  overrides an inherited list, and an inherited "None" is overridden by
  a port list in a vhost; two port lists still merge as a union.
  (allowed_port): Disallow all ports when "none" is set.

* docs/manual/mod/mod_proxy_connect.xml: Clarify the merge behaviour and
  the "None" restriction.

* test/modules/proxy/test_07_connect.py: Added.

* test/modules/proxy/env.py: Load mod_proxy_connect for the suite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Github: closes #719


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937537 13f79535-47bb-0310-9956-ffa450edef68
2026-08-27 20:39:05 +00:00
Eric Covener
2b3075af73 PR68527: fixup_dir segfault with no content-type
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936401 13f79535-47bb-0310-9956-ffa450edef68
2026-07-20 19:50:48 +00:00
Joe Orton
cf75baf6a6 mod_substitute: fix heap over-read in set_pattern() delimiter scanning
* modules/filters/mod_substitute.c (set_pattern): Guard the
  pre-incrementing delimiter scan loops with a NUL check, preventing
  a read past the end of the allocation when the from or to field has
  no closing delimiter.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: closes #685


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936264 13f79535-47bb-0310-9956-ffa450edef68
2026-07-17 12:13:04 +00:00
Joe Orton
3f8cf7cdcf mod_substitute: reject overflow values in SubstituteMaxLineLength
* modules/filters/mod_substitute.c (set_max_line_length): Check that
  the parsed value does not exceed APR_INT64_MAX / multiplier before
  applying the K/M/G suffix, to avoid signed integer overflow UB.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: PR #685


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936263 13f79535-47bb-0310-9956-ffa450edef68
2026-07-17 12:12:54 +00:00
Joe Orton
5486228719 mod_ldap: fix race in LDAP URL cache child cache access
* modules/ldap/util_ldap.c: Hold the LDAP cache lock continuously
  from URL node fetch through child cache access, closing the window
  where a concurrent request could free the node between unlock and
  re-lock.  Re-fetch the URL node under the lock for write-back paths.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: PR #685


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936261 13f79535-47bb-0310-9956-ffa450edef68
2026-07-17 12:12:32 +00:00
Joe Orton
753188653c mod_cern_meta: reject HTTP framing headers in metadata files
* modules/metadata/mod_cern_meta.c (scan_meta_file): Return a 500
  error if a framing header is found in a .meta file rather than
  merging it into the response headers.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: PR #685


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936260 13f79535-47bb-0310-9956-ffa450edef68
2026-07-17 12:12:23 +00:00
Joe Orton
22dc622fc5 mod_remoteip: fix NULL dereference with PROXY v2 LOCAL command
* modules/metadata/mod_remoteip.c (remoteip_process_v2_header): Set
  conn_conf->client_addr and client_ip for the LOCAL case, matching
  the v1 UNKNOWN path.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: PR #685


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936258 13f79535-47bb-0310-9956-ffa450edef68
2026-07-17 12:12:05 +00:00
Joe Orton
f1fef81b64 Improve changes text.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1935578 13f79535-47bb-0310-9956-ffa450edef68
2026-06-23 08:45:11 +00:00
Joe Orton
5ed7719044 Fix pre-1.1.0 compat macros for X509_get0_notBefore/notAfter/serialNumber
The compat macros added in 83d565f for pre-1.1.0 OpenSSL used incorrect
names (X509_get0_before/X509_get0_after) which don't match the actual
API names used in the code (X509_get0_notBefore/X509_get0_notAfter).
This caused link failures when building against OpenSSL 1.0.2.

Also add missing X509_get0_serialNumber compat macro which was used in
ssl_engine_log.c but never shimmed for pre-1.1.0.

Submitted by: Craig Lorentzen <crlorent amazon.com>
Github: closes #673


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1935577 13f79535-47bb-0310-9956-ffa450edef68
2026-06-23 08:44:27 +00:00
Joe Orton
a5a759746b * modules/md/mod_md_config.c: Flip MDServerStatus to disabled by
default.

* docs/manual/mod/mod_md.xml: Update accordingly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1935184 13f79535-47bb-0310-9956-ffa450edef68
2026-06-10 17:01:40 +00:00
Eric Covener
52e6887ece expr parse fail should hide conditional content
these are neither true or false, the enclosing content should not
be printed


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934852 13f79535-47bb-0310-9956-ffa450edef68
2026-06-01 17:41:30 +00:00
Stefan Eissing
4b01268e60 *) mod_http2: update to version 2.0.42
Fix excessive file description use for non-TLS frontend connections when
     sending files. Fixes <https://github.com/icing/mod_h2/issues/325>



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934743 13f79535-47bb-0310-9956-ffa450edef68
2026-05-29 09:09:41 +00:00
Stefan Eissing
47d3100b25 *) mod_http2: update to version 2.0.41
Fix cookie header accounting against LimitRequestFields.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934678 13f79535-47bb-0310-9956-ffa450edef68
2026-05-27 09:37:31 +00:00