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

231 Commits

Author SHA1 Message Date
Yann Ylavic
c3a95d75da Merge r1893971 from trunk:
core: Add ap_unescape_url_ex() for better decoding control, and deprecate
      unused AP_NORMALIZE_DROP_PARAMETERS flag.
 
Submitted by: ylavic
Reviewed by: ylavic, icing, gbechis


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893977 13f79535-47bb-0310-9956-ffa450edef68
2021-10-07 12:27:43 +00:00
Stefan Eissing
6a5d3e006b Merged /httpd/httpd/trunk:r1879074-1879080,1879094-1879095,1879110-1879112,1879114,1879116-1879117,1879137,1879144-1879145,1879147,1879149,1879235,1879360
back port the mapping=servlet proxy logic.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892161 13f79535-47bb-0310-9956-ffa450edef68
2021-08-10 08:27:18 +00:00
Eric Covener
eb986059aa Merge r1889036 from trunk:
legacy default slash-matching behavior w/ 'MergeSlashes OFF'

Submitted By: Ruediger Pluem
Reviewed By: covener, rpluem, ylavic




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889038 13f79535-47bb-0310-9956-ffa450edef68
2021-04-21 01:10:12 +00:00
Christophe Jaillet
c0882d0209 Merge (most of) r1876599 from trunk
* Add missing pool tags to help debugging

Submitted by: ylavic
Reviewed by: jailletc36, gbechis, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1888928 13f79535-47bb-0310-9956-ffa450edef68
2021-04-18 19:11:48 +00:00
Eric Covener
687b7dc748 merge 1855743,1855744 ^/httpd/httpd/trunk .
r->parsed_uri.path safety in recent backport

*) core: fix SEGFAULT in CONNECT with recent change
   2.4.x: svn merge -c 1855743,1855744 ^/httpd/httpd/trunk .
   +1: rpluem, icing, covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855751 13f79535-47bb-0310-9956-ffa450edef68
2019-03-18 12:10:15 +00:00
Stefan Eissing
1a047824fd Merge of r1855705 from trunk:
core: merge consecutive slashes in the path



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855737 13f79535-47bb-0310-9956-ffa450edef68
2019-03-18 08:49:59 +00:00
Christophe Jaillet
92a2afcfc0 Add some spaces that were skipped when r1684524 from trunk has been backported in 2.4.x in r1684525.
(in order to synch 2.4.x and trunk)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1828619 13f79535-47bb-0310-9956-ffa450edef68
2018-04-07 21:04:16 +00:00
Jim Jagielski
ef7fa5ad60 Merge r1735906 from trunk:
Avoid a call to 'prep_walk_cache' if possible, just as in 'ap_if_walk' and 'ap_location_walk'
Submitted by: jailletc36
Reviewed by: jailletc36, jim, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1800267 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 11:29:11 +00:00
Jim Jagielski
78b86cd7aa SECURITY: CVE-2017-3167 (cve.mitre.org)
Use of the ap_get_basic_auth_pw() by third-party modules outside of the
authentication phase may lead to authentication requirements being
bypassed.

Merge r1796348 from trunk:

core: Deprecate ap_get_basic_auth_pw() and add ap_get_basic_auth_components(). 

Submitted By: Emmanuel Dreyfus <manu netbsd.org>, jchampion, coverner
Reviewed by: covener, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796855 13f79535-47bb-0310-9956-ffa450edef68
2017-05-30 12:27:41 +00:00
Jim Jagielski
5c6229bec7 Merge r1792589 from trunk:
Evaluate nested If/ElseIf/Else config sections

It has been reported multiple times that nested
If/ElseIf/Else sections are not evaluated but
silently ignored.

This patch adds a simple recursion to the ap_if_walk
logic in order to allow arbitrary nested configs.
The overhead seems negligible compared to the actual
version of the ap_if_walk, but more expert feedback
is surely needed since this code gets called for every
HTTP request.

Tests are going to be added to t/apache/if_sections.t


Submitted by: elukey
Reviewed by: elukey, jim, yalvic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1795906 13f79535-47bb-0310-9956-ffa450edef68
2017-05-23 12:48:27 +00:00
Jim Jagielski
9dfa9c4839 Merge r1698334 from trunk:
Avoid adding duplicate subequest filters, as they would not be stripped
properly during an ap_internal_fast_redirect.


Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1770672 13f79535-47bb-0310-9956-ffa450edef68
2016-11-21 12:17:13 +00:00
Eric Covener
ba3dbf0ab1 revert 1767482 backport
cleanup next



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1767647 13f79535-47bb-0310-9956-ffa450edef68
2016-11-02 12:01:23 +00:00
Jim Jagielski
c32f066785 Merge r1698239 from trunk:
Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1767482 13f79535-47bb-0310-9956-ffa450edef68
2016-11-01 11:53:57 +00:00
Yann Ylavic
f63f9565a4 Merge r1737114 from trunk:
Fix bug 58528 - Do not read .htaccess if override and overridelist are "None"

Submitted by: druggeri
Reviewed by: druggeri, ylavic, wrowe



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1737366 13f79535-47bb-0310-9956-ffa450edef68
2016-04-01 12:36:42 +00:00
Jim Jagielski
9c11d7ad82 Merge r1719016 from trunk:
There is no need to duplicate some memory  here, the 'path' given to ap_parse_htaccess is never modified.
Submitted by: jailletc36
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1725504 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:55:38 +00:00
Jim Jagielski
c62375851b Merge r1700317, r1700318, r1700319, r1700320, r1700321, r1700322, r1700326, r1700328, r1700330, r1700331, r1700332, r1700334, r1700336, r1700338 from trunk:
Fix some spurious ident spotted by sparse

Silence a sparse warning about inconsistent indenting


Silence a sparse warning about inconsistent indenting


Silence a sparse warning about inconsistent indenting


Silence a sparse warning about inconsistent indenting


Silence a sparse warning about inconsistent indenting


Silence a sparse warning about inconsistent indenting + some minor style issues

Remove useless line

Silence a sparse warning about inconsistent indenting + some minor style issues

Silence a sparse warning about inconsistent indenting + some minor style issues

Silence a sparse warning about inconsistent indenting + some minor style issues

Fix some spurious ident spotted by sparse

Silence a sparse warning about inconsistent indenting + some minor style issues

Silence a sparse warning about inconsistent indenting + some minor style issues
Submitted by: jailletc36
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1701772 13f79535-47bb-0310-9956-ffa450edef68
2015-09-08 11:10:16 +00:00
William A. Rowe Jr
2182cbc99f SECURITY: CVE-2015-3185 (cve.mitre.org)
Replacement of ap_some_auth_required (unusable in Apache httpd 2.4)
with new ap_some_authn_required and ap_force_authn hook.  

Submitted by: breser
Backports: r1684524
Reviewed by: wrowe, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1684525 13f79535-47bb-0310-9956-ffa450edef68
2015-06-09 20:42:44 +00:00
Eric Covener
91c2b83072 revert r1642852 for 2.4.x release purposes. It appears to break
too much DirectoryMatch matching and is not critical to have in.

Discussion on dev@ on trunk rev commit msg for r1635428

Also, I don't think the addition in the middle of the core_dir_config
given that the core_dir_config is exposed to modules as kind
of a special case.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1652902 13f79535-47bb-0310-9956-ffa450edef68
2015-01-19 04:16:28 +00:00
Jim Jagielski
96f790bcb7 Merge r1635428 from trunk:
core: Do not match files when using DirectoryMatch. PR41867.


Submitted by: jkaluza
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1642852 13f79535-47bb-0310-9956-ffa450edef68
2014-12-02 12:43:23 +00:00
Jim Jagielski
858b4b4cbe Merge r1554300, r1554301, r1554994, r1555266 from trunk:
core: Support named groups and backreferences within the LocationMatch,
DirectoryMatch, FilesMatch and ProxyMatch directives.


Documentation for the support of named groups and backreferences.


c89 fix


Add a "MATCH_" prefix to variables set within
LocationMatch/DirectoryMatch/FilesMatch.

Submitted by: minfrin, covener, minfrin
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1555551 13f79535-47bb-0310-9956-ffa450edef68
2014-01-05 16:14:26 +00:00
Graham Leggett
97113724d4 core: Add dirwalk_stat hook.
trunk patch: http://svn.apache.org/r1388447
Submitted by: trawick
Reviewed by: minfrin, jim, sf


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1491476 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 14:46:37 +00:00
Graham Leggett
30e103f715 core: Add post_perdir_config hook.
trunk patch: http://svn.apache.org/r1368121
Submitted by: minfrin
Reviewed by: jim, sf


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1491472 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 14:41:34 +00:00
Rainer Jung
23af3807f5 Comment spelling fix.
CTR

Backport of r1368131 from trunk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1371935 13f79535-47bb-0310-9956-ffa450edef68
2012-08-11 12:42:25 +00:00
Stefan Fritsch
917d8369f2 Merge 1351015:
Adjust log message: Condition can be caused by configuration error
    not only by bugs

Only text change, therefore CTR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1361571 13f79535-47bb-0310-9956-ffa450edef68
2012-07-14 18:43:31 +00:00
Jim Jagielski
6a12a80005 Merge r1301504 from trunk:
add filesystem paths to some common error messages.

(slightly modified from dev@ post to not bury the "failed/denied")


Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1302426 13f79535-47bb-0310-9956-ffa450edef68
2012-03-19 13:33:05 +00:00
William A. Rowe Jr
678bbff9f4 Clean up size_t abuse, part 2. ap_malloc/calloc/realloc are explicitly
excluded from this cleanup as they must be signature identical to the
clib functions, and although the definition of size_t has been flakey,
the definition of those functions appears to be generally clean since
ANSI C.

Backports: r1228323

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1228324 13f79535-47bb-0310-9956-ffa450edef68
2012-01-06 18:15:28 +00:00
Graham Leggett
f3f2abdb9e Backport:
Further clarify the naming of the entity that originates the request by
calling that entity a useragent instead of a client.
Further clarify the naming of the entity that directly connects to us by
calling that entity a client instead of a peer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1214022 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 01:32:31 +00:00
Stefan Fritsch
b6ae8ca44a Backport r1209766, r1210252, r1210284:
Add lots of unique tags to error log messages

ssl_util.c: Downgrade some dynamic locking messages from level DEBUG
to TRACE1-3


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1210287 13f79535-47bb-0310-9956-ffa450edef68
2011-12-05 00:08:01 +00:00
Graham Leggett
71503c53b0 Backport:
Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).
Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1208378 13f79535-47bb-0310-9956-ffa450edef68
2011-11-30 11:03:03 +00:00
Stefan Fritsch
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Daniel Ruggeri
0d69087127 Add AllowOverrideList directive and documentation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151654 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 22:24:14 +00:00
Stefan Fritsch
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
Stefan Fritsch
93623482e3 - Add <ElseIf> and <Else> to complement <If> sections. These are both easier
to use and more efficient than using several <If> sections.
- Update <If> documentation a bit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132469 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 18:15:02 +00:00
Daniel Earl Poirier
fdaaf209c5 core: AllowEncodedSlashes new option NoDecode to allow encoded slashes
in request URL path info but not decode them. Change behavior of option
"On" to decode the encoded slashes as 2.0 and 2.2 do.  PR 35256,
PR 46830.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082196 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 16:45:25 +00:00
Stefan Fritsch
209d890731 Initialize the core_dir_config->sec_files and ->sec_if only if needed.
This saves some memory and two apr_array_append()s per directory merge.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060283 13f79535-47bb-0310-9956-ffa450edef68
2011-01-18 09:58:26 +00:00
Stefan Fritsch
a38d3c9e23 Merge the <If> sections in a separate step ap_if_walk, after ap_location_walk.
This makes <If> apply to all requests, not only to file base requests and
it allows to use <If> inside <Directory>, <Location>, and <Files> sections.

The merging of <If> sections always happens after the merging of <Location>
sections, even if the <If> section is embedded inside a <Directory> or
<Files> section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059867 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17 11:02:38 +00:00
Stefan Fritsch
774529eb10 Save a useless check:
ap_get_request_note() cannot fail unless there is a bug somewhere and if
prep_walk_cache() returned NULL, we would just segfault later on.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1057920 13f79535-47bb-0310-9956-ffa450edef68
2011-01-11 23:10:06 +00:00
Stefan Fritsch
6ef1911acc ap_expr related fixes/enhancements:
- implement regex backreferences and make them available for setting 
  envvars in SetEnvIfExpr
- implement nested function calls in %-syntax: %{func1:%{func2:arg}} 
- actually implement evaluation of concatenation operator (oops...)
- Fix <If ... > treating an internal error as success


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037504 13f79535-47bb-0310-9956-ffa450edef68
2010-11-21 17:22:26 +00:00
Stefan Fritsch
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.

The Netware and Windows build files still need to be adjusted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 14:31:16 +00:00
Eric Covener
749058def7 PR#45722: if we get EACCESS in the directory walk, give the hint that's in 1.3
about search permissions on intermediate directories.  I left the prefix of the message 
as "denied" instead of "failed" to satisfy web searches.


The extended error text was added to 1.3.x but not trunk in 
  http://svn.apache.org/viewvc?view=revision&revision=99781

This plagues users on IRC!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031307 13f79535-47bb-0310-9956-ffa450edef68
2010-11-04 22:36:37 +00:00
Eric Covener
579ab22775 PR49809: Allow DirectoryMatch to match the EOL character ($). and
stop applying to subdirectories (that don't also match the regex) implicitly.  

The manual already uses DirectoryMatch syntax that assumes this in other places!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@990091 13f79535-47bb-0310-9956-ffa450edef68
2010-08-27 10:46:02 +00:00
Stefan Fritsch
a8b19fb99f Add the same r->user == NULL check in the Satisfy Any code path as r965709 did
for Satisfy all


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986606 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 09:24:04 +00:00
Jeff Trawick
0ce133f8a8 Intel's compiler warns about assigning the non-enum value 0 to the
enumeration apr_finfo_t.filetype, which is done when forgetting
the previously-derived file type

use the appropriate enum value APR_NOFILE instead

Also change comparisons of the field with 0 to use APR_NOFILE instead,
as is the practice of some existing code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@983065 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 17:36:52 +00:00
Stefan Fritsch
a527986832 remove more unused variables
revove some obsolete comments

netware file is untested


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982050 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 22:12:19 +00:00
Nick Kew
f5dc2a1177 Don't risk segfault in authz if r->user is not set
PR 42995


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965709 13f79535-47bb-0310-9956-ffa450edef68
2010-07-20 01:34:39 +00:00
Stefan Fritsch
b24bd5dcbe fix log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@964161 13f79535-47bb-0310-9956-ffa450edef68
2010-07-14 20:03:42 +00:00
Stefan Fritsch
f14218c7ad The approach for allowing authorization by user or IP introduced in r956387,
etc. causes problems because the authentication module calls
note_*_auth_failure if authentication fails. This is inappropriate if access is
later allowed because of the IP.

So, instead of calling the auth_checker hook even if authentication failed, we
introduce a new access_checker_ex hook that runs between the access_checker and
the check_user_id hooks. If an access_checker_ex functions returns OK, the
request will be allowed without authentication.

To make use of this, change mod_authz_core to walk the require blocks in the
access_checker_ex phase and deny/allow the request if the authz result does not
depend on an authenticated user. To distinguish a real AUTHZ_DENIED from an
authz provider from an authz provider needing an authenticated user, the latter
must return the new AUTHZ_DENIED_NO_USER code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@964156 13f79535-47bb-0310-9956-ffa450edef68
2010-07-14 19:59:31 +00:00
Stefan Fritsch
9cc65ede67 Don't restore r->user after authn/authz failure. Any authn module that sets
r->user even if authentication failed is broken, anyway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956395 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 19:46:54 +00:00
Stefan Fritsch
b561de7094 Fix authorization by user or IP/ENV/...
Note ap_note_auth_failure() breakage in STATUS


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956387 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 19:15:01 +00:00