From: Daniel Gruno Date: Tue, 18 Mar 2014 17:02:47 +0000 (+0000) Subject: mod_lua: backport r1578870+r1578882 and add to change log. X-Git-Tag: 2.4.10~409 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2d90903abe34dd3d70f6004df1e3a21b6549c58;p=apache mod_lua: backport r1578870+r1578882 and add to change log. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1578964 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index edcaca33f6..7a55a82bc2 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes with Apache 2.4.10 + *) mod_lua: Log an error when the initial parsing of a Lua file fails. + [Daniel Gruno, Filipe Daragon ] Changes with Apache 2.4.9 diff --git a/modules/lua/lua_vmprep.c b/modules/lua/lua_vmprep.c index b0eb01c432..6c0ae93eb7 100644 --- a/modules/lua/lua_vmprep.c +++ b/modules/lua/lua_vmprep.c @@ -354,7 +354,12 @@ static apr_status_t vm_construct(lua_State **vm, void *params, apr_pool_t *lifec : lua_tostring(L, 0)); return APR_EBADF; } - lua_pcall(L, 0, LUA_MULTRET, 0); + if ( lua_pcall(L, 0, LUA_MULTRET, 0) == LUA_ERRRUN ) { + ap_log_perror(APLOG_MARK, APLOG_ERR, 0, lifecycle_pool, APLOGNO(02613) + "Error loading %s: %s", spec->file, + lua_tostring(L, -1)); + return APR_EBADF; + } } #ifdef AP_ENABLE_LUAJIT