mod_fcgid/mod_fcgid-2.3.9-r1919454.patch
Joe Orton a3f1cf806f sync from c9s
switch to using anonymous shm by default
  Resolves: RHEL-50029
2024-07-22 13:45:13 +01:00

41 lines
1.7 KiB
Diff

# ./pullrev.sh 1919454
http://svn.apache.org/viewvc?view=revision&revision=1919454
https://issues.redhat.com/browse/RHEL-50029
only in patch2:
--- mod_fcgid-2.3.9/modules/fcgid/fcgid_proctbl_unix.c
+++ mod_fcgid-2.3.9/modules/fcgid/fcgid_proctbl_unix.c
@@ -136,18 +136,23 @@
fcgid_server_conf *sconf = ap_get_module_config(main_server->module_config,
&fcgid_module);
- /* Remove share memory first */
+ /* Use anonymous SHM segment by default, fall back to name-based. */
+ if ((rv = apr_shm_create(&g_sharemem, shmem_size, NULL,
+ main_server->process->pconf)) != APR_SUCCESS) {
+ /* Remove any existing segment first, ignore errors. */
apr_shm_remove(sconf->shmname_path, main_server->process->pconf);
- /* Create share memory */
- if ((rv = apr_shm_create(&g_sharemem, shmem_size, sconf->shmname_path,
- main_server->process->pconf)) != APR_SUCCESS)
- {
+ rv = apr_shm_create(&g_sharemem, shmem_size, sconf->shmname_path,
+ main_server->process->pconf);
+ if (rv) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, main_server,
- "mod_fcgid: Can't create shared memory for size %" APR_SIZE_T_FMT " bytes",
- shmem_size);
- exit(1);
+ "mod_fcgid: Can't create shared memory either "
+ "anonymous or at %s, for size %" APR_SIZE_T_FMT " bytes",
+ sconf->shmname_path, shmem_size);
+ return rv;
}
+ }
+
_global_memory = apr_shm_baseaddr_get(g_sharemem);
/* Create global mutex */