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

451 Commits

Author SHA1 Message Date
Christophe Jaillet
2ba167652b Remove empty line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1795834 13f79535-47bb-0310-9956-ffa450edef68
2017-05-22 17:54:59 +00:00
Christophe Jaillet
182db5c2af When processing a 'SetEnv' directive, warn if the environment variable name includes a '='. It is likely a configuration error. PR 60249
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1795635 13f79535-47bb-0310-9956-ffa450edef68
2017-05-19 20:51:51 +00:00
Christophe Jaillet
8f446f8d0c Fix directive name in
(s/RemoteIPProxyProtocolDisableNetworks/RemoteIPProxyProtocolExceptions/)

Use cmd->cmd->name instead to be future proof.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790457 13f79535-47bb-0310-9956-ffa450edef68
2017-04-06 20:38:01 +00:00
Daniel Ruggeri
edc3965d1a Rename RemoteIPProxyProtocolDisableHosts to RemoteIPProxyProtocolExceptions
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790169 13f79535-47bb-0310-9956-ffa450edef68
2017-04-05 01:11:36 +00:00
Daniel Ruggeri
485f90e445 Update PROXY handling by removing Optional processing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1789800 13f79535-47bb-0310-9956-ffa450edef68
2017-04-01 13:51:44 +00:00
Daniel Ruggeri
9ec2f2860e Finally include feedback from Ruediger Pluem. Add slave "backoff" verified by Sander Hoentjen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788674 13f79535-47bb-0310-9956-ffa450edef68
2017-03-25 17:24:23 +00:00
Ruediger Pluem
2afa2b4559 * We can have expressions that become true if a regex pattern in the expression
does NOT match. In this case val is NULL and we should just set the value for
  the environment variable like in the pattern case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786235 13f79535-47bb-0310-9956-ffa450edef68
2017-03-09 20:21:19 +00:00
Daniel Ruggeri
eeec392a04 Change tactic for PROXY processing in Optional case
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781701 13f79535-47bb-0310-9956-ffa450edef68
2017-02-04 20:14:18 +00:00
Joe Orton
5ce4c528ae * modules/metadata/mod_remoteip.c (register_hooks,
remoteip_hook_pre_connection): Reference the filter by handle rather
  than name (avoiding tree lookup by name on use).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781031 13f79535-47bb-0310-9956-ffa450edef68
2017-01-31 08:39:11 +00:00
Joe Orton
9930da2560 * modules/metadata/mod_remoteip.c: Fix GCC strict-aliasing warning
by moving deference of header array via a different pointer type 
  ("type-punning") out of line.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781030 13f79535-47bb-0310-9956-ffa450edef68
2017-01-31 08:23:38 +00:00
Daniel Ruggeri
31282c0a4b Set all read buckets aside in case we need to restore all during optional header processing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780725 13f79535-47bb-0310-9956-ffa450edef68
2017-01-28 17:53:58 +00:00
Ruediger Pluem
c4f4ded615 * Silence compiler warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778268 13f79535-47bb-0310-9956-ffa450edef68
2017-01-11 10:23:55 +00:00
Daniel Ruggeri
44a8837e44 Reinsert attribution to mod_remoteip.c for PROXY protocol
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776740 13f79535-47bb-0310-9956-ffa450edef68
2016-12-31 13:40:23 +00:00
Stefan Eissing
1d7573a0f8 On the trunk:
* mod_remoteip: added cast to fix clang compiler error



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776734 13f79535-47bb-0310-9956-ffa450edef68
2016-12-31 13:11:28 +00:00
Daniel Ruggeri
7f7cf96407 Move attribution for mod_remoteip RemoteIPProxyProtocol from file to CHANGES
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776674 13f79535-47bb-0310-9956-ffa450edef68
2016-12-31 02:27:29 +00:00
Daniel Ruggeri
3e4041649d Shorten RemoteIPProxyProtocolEnable to RemoteIPProxyProtocol and correct references in docs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776624 13f79535-47bb-0310-9956-ffa450edef68
2016-12-30 19:06:55 +00:00
Daniel Ruggeri
9a60440612 Merge new PROXY protocol code into mod_remoteip
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776575 13f79535-47bb-0310-9956-ffa450edef68
2016-12-30 14:20:48 +00:00
Eric Covener
992b42a1fe mod_remoteip: Set useragent port to zero PR59931
When overriding the useragent address from X-Forwarded-For,
zero out what had been initialized as the connection-level port.  

Submitted By: Hank Ibell <hwibell gmail.com>



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776458 13f79535-47bb-0310-9956-ffa450edef68
2016-12-29 18:27:12 +00:00
Jacob Champion
091f96ee10 Remove unnecessary apr_table_do() function casts
Function casts can cause hard-to-debug corruption issues if a
declaration is accidentally changed to be incompatible. Luckily, most of
the function casts for apr_table_do() calls are unnecessary. Remove
them, and adjust the signatures for helpers that weren't taking void* as
the first argument.

The remaining helper that requires a cast is http_filter.c's
form_header_field(), which is probably where many of these casts were
copy-pasted from. I have left it as-is: it has other direct callers
besides apr_table_do(), and it's already documented with warnings not to
change the function signature.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769192 13f79535-47bb-0310-9956-ffa450edef68
2016-11-10 20:53:21 +00:00
Rainer Jung
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
William A. Rowe Jr
f4cc76ee71 Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
William A. Rowe Jr
690c6105f9 hostname: Test and log useragent_host per-request across various modules,
including the scoreboard, expression and rewrite engines, setenvif,
authz_host, access_compat, custom logging, ssl and REMOTE_HOST variables.
PR55348  [William Rowe]

This is the complete change set which applies cleanly to 2.4.x as well,
the server/scoreboard.c will follow, which does not apply due to drift.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729930 13f79535-47bb-0310-9956-ffa450edef68
2016-02-12 01:17:03 +00:00
Yann Ylavic
c80e6b2a34 Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:46:01 +00:00
Yann Ylavic
3c9ddf44bf Revert r1715789: will re-commit without spurious functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:28:36 +00:00
Yann Ylavic
29843dc73f Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
[Reverted by r1715869]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 12:33:09 +00:00
Christophe Jaillet
99ba93b4db Remove some useless 'return' statements.
Add a blank line between functions.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715572 13f79535-47bb-0310-9956-ffa450edef68
2015-11-21 20:57:06 +00:00
Christophe Jaillet
8d10037c86 Remove some useless 'return' statements.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715571 13f79535-47bb-0310-9956-ffa450edef68
2015-11-21 20:54:28 +00:00
Christophe Jaillet
68131d85a4 Fix some style issues on files that can easily be synch'ed with 2.4.x
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705983 13f79535-47bb-0310-9956-ffa450edef68
2015-09-30 08:35:35 +00:00
Christophe Jaillet
a4248e423e Fix some spurious ident spotted by sparse
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1700317 13f79535-47bb-0310-9956-ffa450edef68
2015-08-31 19:45:24 +00:00
Yann Ylavic
d9a3b78926 s/\<\(\w\+\)\>\s\+\<\1\>/\1/g
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1690137 13f79535-47bb-0310-9956-ffa450edef68
2015-07-09 18:07:50 +00:00
Jan Kaluža
dd6c959b36 mod_remoteip: Use r->useragent_addr as the root trusted address for verifying.
This fixes issue resulting in setting of bad useragent_ip when internal
redirection has been generated as response to the request (typically as
result of "ErrorDocument 40x").

In this case, the original request has been handled by mod_remoteip and its
useragent_ip has been changed properly, but when internal redirection
to ErrorDocument has been generated later, the mod_remoteip's handler has been
executed again with *the same* c->client_addr as in the original request. If
c->client_addr IP is trusted, this results in bad useragent_ip being set.

When using r->useragent_addr as the root trusted address instead of
c->client_addr, the internal redirection uses the first non-trusted
IP in this particular case, so it won't change the r->useragent_ip during
the internal redirection to ErrorDocument.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1688399 13f79535-47bb-0310-9956-ffa450edef68
2015-06-30 08:40:17 +00:00
Christophe Jaillet
58dedee7d5 Save a few bytes of memory. This can be done in temp_pool.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597182 13f79535-47bb-0310-9956-ffa450edef68
2014-05-23 21:12:16 +00:00
Mike Rumph
af0cfb57b7 Prevent an external proxy from presenting an internal proxy
in mod_remoteip.c. PR 55962.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588330 13f79535-47bb-0310-9956-ffa450edef68
2014-04-17 18:14:49 +00:00
Yann Ylavic
df97e149c0 mod_expires: don't add Expires header to error responses (4xx/5xx),
be they generated or forwarded. PR 55669.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584430 13f79535-47bb-0310-9956-ffa450edef68
2014-04-03 22:20:15 +00:00
Mike Rumph
18dedf6db5 Use the correct IP addresses to populate the proxy_ips field
in mod_remoteip.c.  PR 55972.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564475 13f79535-47bb-0310-9956-ffa450edef68
2014-02-04 20:38:01 +00:00
Mike Rumph
1ef8c3824c Correct the trusted proxy match test in mod_remoteip. PR 54651.\n\nSubmitted By: Yoshinori Ehara <yoshinori ehara gmail com>\nEndorsed By: Eugene L <eugenel amazon com>\nCommited By: mrumph
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564052 13f79535-47bb-0310-9956-ffa450edef68
2014-02-03 21:01:17 +00:00
Eric Covener
5a63e124b6 This is annoying to see in a casual "LogLevel debug foo:traceX ..."
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1552130 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 22:25:50 +00:00
Christophe Jaillet
9bda8db764 Ease logic around 'ap_getword_conf' and drop useless line of code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1551009 13f79535-47bb-0310-9956-ffa450edef68
2013-12-15 10:23:07 +00:00
Christophe Jaillet
af7096d97d s/equivalant/equivalent/ in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1550828 13f79535-47bb-0310-9956-ffa450edef68
2013-12-13 19:56:41 +00:00
Christophe Jaillet
7c7861d8d1 Remove redundant check
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1550651 13f79535-47bb-0310-9956-ffa450edef68
2013-12-13 06:04:02 +00:00
Christophe Jaillet
b867906b6b s/ip/IP/ in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1550650 13f79535-47bb-0310-9956-ffa450edef68
2013-12-13 06:01:28 +00:00
Eric Covener
d5174b9fcd If the "value" argument is prefixed with expr=, parse it with ap_expr
rather than mod_headers' built-in format strings.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1546801 13f79535-47bb-0310-9956-ffa450edef68
2013-12-01 11:23:22 +00:00
Daniel Ruggeri
ffdb1b50a1 Allow for format specifiers to be used in the base substitution string for Header edit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1535788 13f79535-47bb-0310-9956-ffa450edef68
2013-10-25 17:16:46 +00:00
Eric Covener
46d97009e1 add "Header note" which was the solution for two users this week on IRC.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1520908 13f79535-47bb-0310-9956-ffa450edef68
2013-09-08 20:04:06 +00:00
Joe Orton
b6728179bb * modules/metadata/mod_unique_id.c: Replace use of hostname + pid with
PRNG output.

Submitted by: Jan Kaluza <jkaluza redhat.com>
Reviewed by: sf, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1501827 13f79535-47bb-0310-9956-ffa450edef68
2013-07-10 16:20:31 +00:00
Eric Covener
1c3427493e provide a simple (no <If>) way to set a header only if it's not already there.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496338 13f79535-47bb-0310-9956-ffa450edef68
2013-06-25 02:20:36 +00:00
Christophe Jaillet
9c2018878f Reduce stack usage by 3k
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491724 13f79535-47bb-0310-9956-ffa450edef68
2013-06-11 10:17:02 +00:00
Christophe Jaillet
8e247b6cee According to comment in 'magic_rsl_add' and to the way 'magic_rsl_printf' manages its buffer, I think that this memory should be apr_pstrdup'ed.
This has been like that forever, but seems broken to me.

Untested.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491700 13f79535-47bb-0310-9956-ffa450edef68
2013-06-11 07:41:40 +00:00
Christophe Jaillet
23b15cc92a Close file in error path.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491234 13f79535-47bb-0310-9956-ffa450edef68
2013-06-09 16:00:18 +00:00
Ruediger Pluem
5f4c783e03 * Fix null pointer dereference in case SetEnvif and SetEnvIfExpr are used
together.

PR: 54881


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1471449 13f79535-47bb-0310-9956-ffa450edef68
2013-04-24 14:58:10 +00:00