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

65 Commits

Author SHA1 Message Date
Eric Covener
52dd3e5e00 Merge r1657261 from trunk:
*) SECURITY: CVE-2015-0228 (cve.mitre.org)
     mod_lua: A maliciously crafted websockets PING after a script
     calls r:wsupgrade() can cause a child process crash.
     [Edward Lu <Chaosed0 gmail.com>]

Discovered by Guido Vranken <guidovranken gmail.com>

Submitted by: Edward Lu
Committed by: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1664118 13f79535-47bb-0310-9956-ffa450edef68
2015-03-04 19:18:27 +00:00
Eric Covener
23e90b697e Merge r1657256 from trunk:
Fix bit-shifting of websockets frame fields that would yield wrong opcodes
when the FIN bit was set.  Results in PING not being recognized
by mod_lua.  PR57524

Submitted By: Edward Lu
Committed By: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1664117 13f79535-47bb-0310-9956-ffa450edef68
2015-03-04 19:17:32 +00:00
Jim Jagielski
1f3956473e Merge r1611978, r1612068 from trunk:
Add missing APLOGNO.
Refactor to keep APLOGNO on the same line as ap_log_error, when applicable.

Add missing APLOGNO.
Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable.
Split lines longer than 80.
Improve alignment.
Submitted by: jailletc36
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1622706 13f79535-47bb-0310-9956-ffa450edef68
2014-09-05 14:20:27 +00:00
Daniel Gruno
0b27b4944e backport for mod_lua: Don't quote values in cookies; Make IE happy again [#56734]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1611744 13f79535-47bb-0310-9956-ffa450edef68
2014-07-18 18:15:42 +00:00
Joe Orton
4bbf0508ea Merge 1610491 from trunk:
SECURITY (CVE-2014-0226): Fix a race condition in scoreboard handling,
which could lead to a heap buffer overflow.  Thanks to Marek Kroemeke
working with HP's Zero Day Initiative for reporting this.

* include/scoreboard.h: Add ap_copy_scoreboard_worker.

* server/scoreboard.c (ap_copy_scoreboard_worker): New function.

* modules/generators/mod_status.c (status_handler): Use it.

* modules/lua/lua_request.c (lua_ap_scoreboard_worker): Likewise.

Reviewed by: trawick, jorton, covener, jim
Submitted by: jorton, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1610499 13f79535-47bb-0310-9956-ffa450edef68
2014-07-14 19:55:04 +00:00
Daniel Gruno
84be129a85 mod_lua: Sync 2.4.x with trunk (more or less); Backport a fix and some code harmonization:
- IVM changed to use shm
- More verbose error logging (no functional change)
- Miscellaneous refactoring that was in trunk but not in 2.4.x (no functional change as such)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1604339 13f79535-47bb-0310-9956-ffa450edef68
2014-06-21 11:19:40 +00:00
Daniel Gruno
10f596b210 C89 and such
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1589430 13f79535-47bb-0310-9956-ffa450edef68
2014-04-23 14:42:18 +00:00
Daniel Gruno
a7426b2cb7 fix lua_ap_requestbody (bad backport?)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1588915 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 16:23:32 +00:00
Daniel Gruno
b35526d5e2 Backport r1588807
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1588808 13f79535-47bb-0310-9956-ffa450edef68
2014-04-20 17:56:41 +00:00
Daniel Gruno
01785993ed mod_lua: backport the two parsebody fixes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1588762 13f79535-47bb-0310-9956-ffa450edef68
2014-04-20 14:02:22 +00:00
Daniel Gruno
707e187891 mod_lua: Give me all the backports and eggs you have. (see CHANGES)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1582968 13f79535-47bb-0310-9956-ffa450edef68
2014-03-29 09:15:33 +00:00
Daniel Gruno
7ed8b01180 mod_lua: escape key/value pairs when setting cookies to prevent header splitting with tainted cookies.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1582255 13f79535-47bb-0310-9956-ffa450edef68
2014-03-27 11:00:34 +00:00
Daniel Gruno
f40cc3cab2 mod_lua: Backport setcookie changes. PR 56128
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1570162 13f79535-47bb-0310-9956-ffa450edef68
2014-02-20 11:54:27 +00:00
Eric Covener
09bd7be2ae Merge r1567221 from trunk:
mod_lua: Fix r:setcookie() to add, rather than replace,
the Set-Cookie header. PR56105

Submitted By: Kevin J Walters <kjw ms com>, Edward Lu <Chaosed0 gmail com>
Committed By: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1567328 13f79535-47bb-0310-9956-ffa450edef68
2014-02-11 19:35:52 +00:00
Daniel Gruno
b508cd24d3 Backport r1564727: Fix support for uploading files by using pushlstring instead of pushstring when pushing binary data.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1564729 13f79535-47bb-0310-9956-ffa450edef68
2014-02-05 12:13:11 +00:00
Daniel Gruno
73d324a455 mod_lua: Detect "All" or "None" before putting together a potentially blank (or static) string.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1555070 13f79535-47bb-0310-9956-ffa450edef68
2014-01-03 12:20:13 +00:00
Eric Covener
b433a30ee5 Merge r1551968 from trunk:
get arpa/inet.h from apr_want.h for htons where applicable




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1551969 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 15:03:19 +00:00
Jim Jagielski
4bea5d7adc Merge r1544820 from trunk:
mod_lua: Fix compiler warning by using correct
APR_SIZE_T_FMT and APR_OFF_T_FMT format macro
in debug logging.

Submitted by: rjung
Reviewed/backported by: jim

NOTE: Not sure about CHANGES... is there a BUGZ on this?
In general, CHANGES is for userland visible changes or
BUGZ bug fixes, and not sure if this really applies
here. But it's OK if someone wants to add something
to CHANGES.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1546976 13f79535-47bb-0310-9956-ffa450edef68
2013-12-02 12:18:19 +00:00
Daniel Gruno
6f55ec2af0 backport mod_lua changes(r1524321): check for big endian and don't fiddle with bits if so.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1524328 13f79535-47bb-0310-9956-ffa450edef68
2013-09-18 08:08:58 +00:00
Daniel Gruno
f41d8a48ea Backport a few things in mod_lua:
- Fix filters
- Add setcookie/getcookie
- Add preliminary WebSocket support
- Update documentation

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1523974 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 10:38:12 +00:00
Graham Leggett
ef694d32a6 modules: Fix some compiler warnings.
trunk patch: http://svn.apache.org/r1500345
             http://svn.apache.org/r1500362
             http://svn.apache.org/r1500423
             http://svn.apache.org/r1500483
             http://svn.apache.org/r1500519

Submitted by: fuankg
Reviewed by: jim, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1523259 13f79535-47bb-0310-9956-ffa450edef68
2013-09-14 14:44:23 +00:00
Guenter Knauf
f0c944f49a Added new r:touch() function; updated docs.
(Backport r1495270, r1495665, r1495666)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1496483 13f79535-47bb-0310-9956-ffa450edef68
2013-06-25 14:19:51 +00:00
Graham Leggett
378f774ab1 mod_lua: Fully sync 2.4.x with trunk (catch up to r1490700):
2.4.x patch: http://www.humbedooh.com/mod_lua_2013_06_07.patch
Submitted by: humbedooh
Reviewed by: fuankg, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1491468 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 14:36:56 +00:00
Graham Leggett
04bd9d4b2f mod_lua: Sync 2.4 branch with trunk. This includes (but is not limited to)
Server pools, new apr functions for the request_rec table, input/output filters,
LuaCodeCache, LuaMapHandler and multipart form data handling. This is long
overdue, and has become too spaghetti-ish to propose in chunks :|

trunk patch: http://svn.apache.org/r1366890
             http://svn.apache.org/r1367025
             http://svn.apache.org/r1367040
             http://svn.apache.org/r1367048
             http://svn.apache.org/r1383024
             http://svn.apache.org/r1383028
             http://svn.apache.org/r1383037
             http://svn.apache.org/r1367725
             http://svn.apache.org/r1367875
             http://svn.apache.org/r1368109
             http://svn.apache.org/r1369656
             http://svn.apache.org/r1369793
             http://svn.apache.org/r1369800
             http://svn.apache.org/r1370158
             http://svn.apache.org/r1433967
             http://svn.apache.org/r1429169
             http://svn.apache.org/r1425450
             http://svn.apache.org/r1425243
             http://svn.apache.org/r1422552
             http://svn.apache.org/r1422548
             http://svn.apache.org/r1422531
             http://svn.apache.org/r1422373
             http://svn.apache.org/r1422072
             http://svn.apache.org/r1421784
             http://svn.apache.org/r1421780
             (the list goes on...)
    2.4.x patch: http://www.humbedooh.com/mod_lua_sync.patch (+CHANGES)

Submitted by: humbedooh
Reviewed by: jim, covener, fuankg


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1490599 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 11:51:28 +00:00
Daniel Gruno
598ad844a2 Backport lua dbd bindings to 2.4
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1439099 13f79535-47bb-0310-9956-ffa450edef68
2013-01-27 15:31:45 +00:00
Rainer Jung
cd18be4d4c Big mod_lua backport:
r1201460: Add some todos from apachecon notes.
          Submitted by: covener

r1351012: Change prototype of vm_construct, to work around gcc bug which
          causes a segfault.  PR: 52779
          Submitted by: Dick Snippe <Dick Snippe tech omroep nl>

r1351013: Allow tail call optimization in log methods, remove foo method.
          Submitted by: sf

r1351014: Add a few missing request_rec fields. Rename remote_ip to
          client_ip to match conn_rec.
          Submitted by: sf

r1351017: Change various strings from char * to const char *.
          Submitted by: sf

r1351018: Factor common code into utility function.
          Also improve logging a bit and adjust some log levels.
          Submitted by: sf

r1351019: Use macro to make definition of integer fields more compact.
          Submitted by: sf

Reviewed by: humbedooh, covener, sf
Backported by: humbedooh, rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1369494 13f79535-47bb-0310-9956-ffa450edef68
2012-08-04 22:21:56 +00:00
Jim Jagielski
f9e205b857 Merge r1352047, r1361298 from trunk:
Add the missing parsebody function to mod_lua, for parsing POST data.
PR 53064.

- Define LUA_COMPAT_ALL so mod_lua will be compatible with Lua 5.2
- Add an optional integer argument for parsebody, specifying the maximum size of POST that will be accepted.
Submitted by: humbedooh
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1365539 13f79535-47bb-0310-9956-ffa450edef68
2012-07-25 11:50:06 +00:00
Stefan Fritsch
1d55e0041e Merge r1300766:
Fix some typos

No logic change. I think this is CTR, please correct me if I am wrong.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1301701 13f79535-47bb-0310-9956-ffa450edef68
2012-03-16 18:58:18 +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
Jim Jagielski
ca0f90bb48 Merge r1200475, r1200478, r1200482, r1200491, r1200513, r1200550, r1200580, r1200605, r1200612, r1200614, r1200639, r1200646, r1200656, r1200667, r1200679, r1200699, r1200957, r1200961, r1200963 from trunk:
fix issue with incorrect munging of the lua package path -- LuaPackagePath directives were not working

Default to not allowing htaccess in /, instead of just the documentroot, which gets a nice 10% performance boost by default for me.

* modules/ssl/ssl_private.h, modules/ssl/ssl_engine_kernel.c
  (ssl_callback_tlsext_tickets): Use unsigned char * to fix gcc
  -Wpointer-sign warnings.


Only load the really imporant modules (i.e. those enabled by the 'few'
selection) by default. Don't handle modules enabled with --enable-foo
specially.

This fixes problems with module dependencies until someone implements a
mechanism for resolving module dependencies.


remove last traces of the code cache

* modules/proxy/mod_proxy_html.c (comp_urlmap): Fix const-ness warning.


* modules/lua/mod_lua.c (ap_lua_ssl_is_https): New function.
  (lua_post_config): Pick up ssl_is_https optional function.

* modules/lua/lua_request.c (req_ssl_is_https_field): New function.
  (ap_lua_load_request): Map is_https field to above.


remove some debug logging which snuck in

remove ability to set min and max pool sizes for server scope in prep for removing server scope

remove lingering reslist references before killing server scope

replace server scope with thread scope

use a sub-pool for scope_once

Fix installation of conf/extra/proxy-html.conf.

Otherwise httpd does no longer start, because
it is the only extra file required in the main
config at the moment.


Rebuild xdoc transform


Clarify docs for LimitRequestLine, as per bug #51665.


Rebuild doc transforms.

Submitted by: brianm, pquerna, jorton, sf, brianm, jorton, jorton, sf, pquerna, brianm, brianm, brianm, brianm, brianm, jorton, rjung, rbowen, rbowen, rbowen
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1200981 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 17:36:46 +00:00
Eric Covener
e66f481ac3 expose r:trace1-8
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200432 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 17:10:17 +00:00
Eric Covener
2af550c8c9 mod_lua: Expose SSL variables via r:ssl_var_lookup()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199056 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 01:53:15 +00:00
Eric Covener
eaffe604d0 correct return val, the char* is pushed on the lua stack.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199028 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 00:25:47 +00:00
Eric Covener
9143f29d2d provide ap_escape_html as r:escape_html()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197838 13f79535-47bb-0310-9956-ffa450edef68
2011-11-05 00:16:36 +00:00
Eric Covener
214b8e88b0 make r.handler and r.proxyreq readable too
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195172 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 14:39:20 +00:00
Eric Covener
1abbc00118 add constants for PROXYREQ_* to the apache2 global, allow r.proxyreq and
r.handler to be writable.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195168 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 14:30:04 +00:00
Eric Covener
89b65554be alphabetize writable lua properties and use strcmp() for the oddball that's
just testing quality of "user".



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195167 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 14:19:45 +00:00
Eric Covener
70ebce981b make r.args read/write for rewrite refugees.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1194997 13f79535-47bb-0310-9956-ffa450edef68
2011-10-29 19:42:32 +00:00
Eric Covener
10c800bb95 expose ap_construct_url to lua scripts
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1187743 13f79535-47bb-0310-9956-ffa450edef68
2011-10-22 18:07:43 +00:00
Stefan Fritsch
45cbf99b00 Fix format string bugs in mod_lua. Found by gcc and pointed out by Igor Galic.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180332 13f79535-47bb-0310-9956-ffa450edef68
2011-10-08 07:50:06 +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
Brian McCallister
12a304c223 expose subprocess_env on lua request object
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@967143 13f79535-47bb-0310-9956-ffa450edef68
2010-07-23 15:52:37 +00:00
Guenter Knauf
0cda847081 Added casts to make strict compilers happy.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965314 13f79535-47bb-0310-9956-ffa450edef68
2010-07-18 23:02:29 +00:00
William A. Rowe Jr
f0d46a36f1 Mop up more than a dozen const'ness faults
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953216 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10 04:42:52 +00:00
William A. Rowe Jr
7716d3c3e3 Drop ap_body_to_table due to missing constraints; a DoS waiting
for an exploit.

Some mod_lua fan aught to revisit this and provide a sensible
implementation.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953203 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10 03:02:07 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Stefan Fritsch
9d791e0e60 Fix some modules to make them compile with per-module loglevels.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951894 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:56:08 +00:00
Brian McCallister
796d34a469 expose r->notes to lua
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833141 13f79535-47bb-0310-9956-ffa450edef68
2009-11-05 19:31:27 +00:00