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

51 Commits

Author SHA1 Message Date
Jan Kaluža
245cecccf7 * mod_lua: fix compilation with lua-5.3 (r1668827)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1668831 13f79535-47bb-0310-9956-ffa450edef68
2015-03-24 09:46:42 +00:00
Jim Jagielski
69eb3c6cfc Merge r1642499 from trunk:
*) SECURITY: CVE-2014-8109 (cve.mitre.org)
     mod_lua: Fix handling of the Require line when a LuaAuthzProvider is
     used in multiple Require directives with different arguments.
     PR57204 [Edward Lu <Chaosed0 gmail.com>]

Submitted By: Edward Lu
Committed By: covener


Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1642861 13f79535-47bb-0310-9956-ffa450edef68
2014-12-02 12:50:59 +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
Jeff Trawick
e1c0c77fb9 Merge r1604631 from trunk:
Follow up to r1604336: Comment out hooks whose only references are
now commented out, fixing a "-Wunused-function" warning


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1604633 13f79535-47bb-0310-9956-ffa450edef68
2014-06-22 18:16:21 +00:00
Daniel Gruno
1bd684d69c mod_lua: Backport disabling of early/late in LuaHookCheckUserID
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1604340 13f79535-47bb-0310-9956-ffa450edef68
2014-06-21 11:21: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
1b61caf3b9 mod_lua: Reformat and escape script error output.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1582251 13f79535-47bb-0310-9956-ffa450edef68
2014-03-27 10:47:35 +00:00
Daniel Gruno
31b2c080a0 mod_lua: Add a fixups hook that checks if the original request is intended
for LuaMapHandler. This fixes a bug where FallbackResource invalidates the 
LuaMapHandler directive in certain cases by changing the URI before the map 
handler code executes [Daniel Gruno].

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1577145 13f79535-47bb-0310-9956-ffa450edef68
2014-03-13 12:55:53 +00:00
Graham Leggett
5eca70cf6f * easy proposals to synch 2.4.x and trunk
- log.c: avoid needless apr_pstrdup()
  - Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
  - Use apr_pstrmemdup instead of apr_pstrndup when this is safe.
  - Remove redundant check
  - 'ap_getword_conf' does not return NULL but an empty string
  - Ease logic around 'ap_getword_conf' and drop useless line of code.
  - 'ap_getword_conf' can not return NULL
  - 'ap_getword_conf' can not return NULL
  - Remove redundant check (already performed the line before)
  - Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable
trunk patches:
  - https://svn.apache.org/viewvc?view=revision&revision=1532122
  - https://svn.apache.org/viewvc?view=revision&revision=1549676
  - https://svn.apache.org/viewvc?view=revision&revision=1549680
  - https://svn.apache.org/viewvc?view=revision&revision=1550651
  - https://svn.apache.org/viewvc?view=revision&revision=1551005
  - https://svn.apache.org/viewvc?view=revision&revision=1551009
  - https://svn.apache.org/viewvc?view=revision&revision=1551010
  - https://svn.apache.org/viewvc?view=revision&revision=1551011
  - https://svn.apache.org/viewvc?view=revision&revision=1551012
  - https://svn.apache.org/viewvc?view=revision&revision=1551013
2.4.x patches: trunk patches work
               http://people.apache.org/~jim/patches/ez-2.4-v2.patch
+1: jailletc36, jim, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1553532 13f79535-47bb-0310-9956-ffa450edef68
2013-12-26 18:08:28 +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
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
Jim Jagielski
30ed35311d Merge r1351020, r1370466 from trunk:
Add new directive LuaAuthzProvider to allow implementing an
authorization provider in lua


There is only one global provider name space, therefore allow
LuaAuthzProvider only in global scope.

Remove unnecessary server config field.

Submitted by: sf
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1374252 13f79535-47bb-0310-9956-ffa450edef68
2012-08-17 13:45:22 +00:00
Jim Jagielski
2071a9f888 Merge r1361801 from trunk:
Various code clean up

Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52893 

Submitted by: sf
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1373092 13f79535-47bb-0310-9956-ffa450edef68
2012-08-14 20:57:43 +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
Stefan Fritsch
0bbad651c4 Various code cleanup to avoid compiler, cppcheck, or clang warnings:
modules/filters/mod_charset_lite.c: Remove dead assignments

modules/filters/mod_include.c: likewise

modules/metadata/mod_usertrack.c: likewise

modules/proxy/mod_proxy_ftp.c: likewise

modules/ssl/ssl_engine_pphrase.c: likewise

modules/proxy/mod_proxy_balancer.c: likewise;
                                    Remove NULL check that can never happen

modules/proxy/proxy_util.c: Axe NULL-check that can never happen and if it
                            would, it would just mask another bug

os/unix/unixd.c: likewise

modules/http/http_filters.c: Remove sub-condition that is always true

modules/lua/mod_lua.c: Add default cases to switch statements

modules/generators/mod_autoindex.c: Unsigned value can never be < 0

server/util_expr_eval.c: Fix compiler warnings with VC and on OS2


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1220509 13f79535-47bb-0310-9956-ffa450edef68
2011-12-18 18:02:21 +00:00
Stefan Fritsch
949075d7d5 Merge r1220462:
remove some dead code
found by clang statical analyzer


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1220507 13f79535-47bb-0310-9956-ffa450edef68
2011-12-18 17:58:25 +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
Eric Covener
14dfa1810b Merge r1201443 from trunk:
add per-dir config merging to mod_lua so LuaHook* in multiple per-dir sections
behaves as expected instead of discarding previous sections.


Reviewed by: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1201445 13f79535-47bb-0310-9956-ffa450edef68
2011-11-13 15:56:20 +00:00
Rainer Jung
47c15640e7 Use the right lua scope when used as a hook.
Backport of r1201042 from trunk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1201046 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 20:51:32 +00:00
Jim Jagielski
d0695db46f Merge r1200977 from trunk:
don't let thread-scope be selected in a server w/o threads


Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1200983 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 17:38:11 +00:00
Jim Jagielski
85fbc378e3 Merge r1200975 from trunk:
C99 and unused variable warnings

Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1200982 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 17:37:26 +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
2fb4d8c18f ap_check_cmd_context checks don't work on the block forms
of the lua directives.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200204 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 07:30:55 +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
d63996c35d allow some lua hooks to be run in "early" or "late" mode
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199031 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 00:36:03 +00:00
Eric Covener
629d9075cb quick handlers and translate_name in lua can't be keyed off
Directory/Filename/htaccess



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197853 13f79535-47bb-0310-9956-ffa450edef68
2011-11-05 01:08:05 +00:00
Eric Covener
bb2c7989ea get the hello world of Handlers working again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197782 13f79535-47bb-0310-9956-ffa450edef68
2011-11-04 21:17:57 +00:00
Eric Covener
562c9d7876 quick handler in an external file is already enabled, quick handler in block
form seems to work just as well.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1187748 13f79535-47bb-0310-9956-ffa450edef68
2011-10-22 18:50:45 +00:00
Stefan Fritsch
374a42b9a0 More style fixes, no func changes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174937 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:20:43 +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
Stefan Fritsch
7b61bedb2f Change the ap_cfg_getline() and ap_cfg_getc() to return an error code.
Also:
- Make ap_cfg_getline() return APR_ENOSPC if a config line is too long.
- Add ap_pcfg_strerror() function to convert ap_cfg_getline's return value
  into a nice message.
- Adjust definition of ap_configfile_t accordingly.

Not bumping MMN because it has already been bumped today.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086756 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 21:29:34 +00:00
Brian McCallister
2fed37e78a apply patch from zhiguo zhao <zhaozg@gmail.com> to significantly improve server scope handling
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081611 13f79535-47bb-0310-9956-ffa450edef68
2011-03-14 23:43:23 +00:00
Stefan Fritsch
affc4cf328 save some memory by using cmd->temp_pool instead of cmd->pool in some places
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002156 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 13:19:33 +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
Daniel Earl Poirier
1f4b662ca5 Add info to debug logging.
Avoid null pointer dereference by returning if we can't get
a lua VM.
Move "we got a VM" message to after we know we have one.
Check that we found the lua handler function before trying to
call it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@939987 13f79535-47bb-0310-9956-ffa450edef68
2010-05-01 12:04:27 +00:00
Joe Orton
0aa10f9c58 * modules/lua/: s/apr_strnatcmp/strcmp/ - strnat*cmp functions are
for natural order string sorting.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832910 13f79535-47bb-0310-9956-ffa450edef68
2009-11-04 23:39:57 +00:00
William A. Rowe Jr
aa4b1cff0b fix symbol space and exports
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758428 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 20:09:08 +00:00
Ruediger Pluem
bd4a986cf3 * Remove unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728621 13f79535-47bb-0310-9956-ffa450edef68
2008-12-22 06:45:32 +00:00
Paul Querna
9ad474c462 Use the HTTP_INTERNAL_SERVER_ERROR define instead of 500 directly.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728568 13f79535-47bb-0310-9956-ffa450edef68
2008-12-22 01:05:25 +00:00
Paul Querna
2e920b6abf Fix more ISO C90 forbids mixed declarations and code...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728544 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 22:53:08 +00:00
Paul Querna
ce336c773a Attempt to make mod_lua compile under a strict c89 compiler by moving all variable declarations to be before code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728539 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 22:38:07 +00:00
Paul Querna
db88fbdb27 Change apl_get_lua_state to take a apl_vm_spec instead of a filename, and to
load the bytecode if it is present, rather than the file, as this gets the 
inline config file blocks hooks working again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728531 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 22:21:54 +00:00
Paul Querna
729bcf2b58 Reformat mod_lua according to the HTTP Server Project C Style Guide:
<http://httpd.apache.org/dev/styleguide.html>
No functional changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728516 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 21:41:52 +00:00
Paul Querna
3cb4269f13 Make all of the hook callbacks static functions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728511 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 21:31:02 +00:00
Paul Querna
21b46796ac Fixup lua_config.c with prefix rename, and make mod_lua.c so it compiles again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728509 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 21:29:11 +00:00
Paul Querna
3948867f51 Rename all files in mod_lua to have a lua_ prefix, as things like 'config.h' are way to generic and will often conflict with other include files.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728508 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 21:27:01 +00:00
Paul Querna
afcdc6d85c Rename most of the module formally known as mod_wombat to mod_lua conventions, switching apw prefixes for apl.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728506 13f79535-47bb-0310-9956-ffa450edef68
2008-12-21 21:17:15 +00:00