|
|
f0c688 |
# ./pullrev.sh 1738229
|
|
|
f0c688 |
|
|
|
f0c688 |
https://bugzilla.redhat.com/show_bug.cgi?id=1225116
|
|
|
f0c688 |
|
|
|
f0c688 |
As for mod_auth_digest, fix to use anonymous SHM by default.
|
|
|
f0c688 |
|
|
|
f0c688 |
http://svn.apache.org/viewvc?view=revision&revision=1738229
|
|
|
f0c688 |
|
|
|
f0c688 |
--- httpd-2.4.18/modules/lua/mod_lua.c
|
|
|
f0c688 |
+++ httpd-2.4.18/modules/lua/mod_lua.c
|
|
|
f0c688 |
@@ -83,6 +83,8 @@
|
|
|
f0c688 |
int broken;
|
|
|
f0c688 |
} lua_filter_ctx;
|
|
|
f0c688 |
|
|
|
f0c688 |
+#define DEFAULT_LUA_SHMFILE "lua_ivm_shm"
|
|
|
f0c688 |
+
|
|
|
f0c688 |
apr_global_mutex_t *lua_ivm_mutex;
|
|
|
f0c688 |
apr_shm_t *lua_ivm_shm;
|
|
|
f0c688 |
char *lua_ivm_shmfile;
|
|
|
f0c688 |
@@ -1995,7 +1997,6 @@
|
|
|
f0c688 |
apr_pool_t *ptemp, server_rec *s)
|
|
|
f0c688 |
{
|
|
|
f0c688 |
apr_pool_t **pool;
|
|
|
f0c688 |
- const char *tempdir;
|
|
|
f0c688 |
apr_status_t rs;
|
|
|
f0c688 |
|
|
|
f0c688 |
lua_ssl_val = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup);
|
|
|
f0c688 |
@@ -2011,21 +2012,20 @@
|
|
|
f0c688 |
return HTTP_INTERNAL_SERVER_ERROR;
|
|
|
f0c688 |
}
|
|
|
f0c688 |
|
|
|
f0c688 |
- /* Create shared memory space */
|
|
|
f0c688 |
- rs = apr_temp_dir_get(&tempdir, pconf);
|
|
|
f0c688 |
- if (rs != APR_SUCCESS) {
|
|
|
f0c688 |
- ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02664)
|
|
|
f0c688 |
- "mod_lua IVM: Failed to find temporary directory");
|
|
|
f0c688 |
- return HTTP_INTERNAL_SERVER_ERROR;
|
|
|
f0c688 |
+ /* Create shared memory space, anonymous first if possible. */
|
|
|
f0c688 |
+ rs = apr_shm_create(&lua_ivm_shm, sizeof pool, NULL, pconf);
|
|
|
f0c688 |
+ if (APR_STATUS_IS_ENOTIMPL(rs)) {
|
|
|
f0c688 |
+ /* Fall back to filename-based; nuke any left-over first. */
|
|
|
f0c688 |
+ lua_ivm_shmfile = ap_runtime_dir_relative(pconf, DEFAULT_LUA_SHMFILE);
|
|
|
f0c688 |
+
|
|
|
f0c688 |
+ apr_shm_remove(lua_ivm_shmfile, pconf);
|
|
|
f0c688 |
+
|
|
|
f0c688 |
+ rs = apr_shm_create(&lua_ivm_shm, sizeof pool, lua_ivm_shmfile, pconf);
|
|
|
f0c688 |
}
|
|
|
f0c688 |
- lua_ivm_shmfile = apr_psprintf(pconf, "%s/httpd_lua_shm.%ld", tempdir,
|
|
|
f0c688 |
- (long int)getpid());
|
|
|
f0c688 |
- rs = apr_shm_create(&lua_ivm_shm, sizeof(apr_pool_t**),
|
|
|
f0c688 |
- (const char *) lua_ivm_shmfile, pconf);
|
|
|
f0c688 |
if (rs != APR_SUCCESS) {
|
|
|
f0c688 |
ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02665)
|
|
|
f0c688 |
"mod_lua: Failed to create shared memory segment on file %s",
|
|
|
f0c688 |
- lua_ivm_shmfile);
|
|
|
f0c688 |
+ lua_ivm_shmfile ? lua_ivm_shmfile : "(anonymous)");
|
|
|
f0c688 |
return HTTP_INTERNAL_SERVER_ERROR;
|
|
|
f0c688 |
}
|
|
|
f0c688 |
pool = (apr_pool_t **)apr_shm_baseaddr_get(lua_ivm_shm);
|