diff options
author | Graham Leggett <minfrin@apache.org> | 2003-01-21 11:46:57 +0100 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2003-01-21 11:46:57 +0100 |
commit | ba6fad167161575bad75ad984ce7b4ebd464680a (patch) | |
tree | 4780cf5ddc863dd3b503c5b48793f117552e0eda | |
parent | Copy mod_auth.h when installing includes. (diff) | |
download | apache2-ba6fad167161575bad75ad984ce7b4ebd464680a.tar.xz apache2-ba6fad167161575bad75ad984ce7b4ebd464680a.zip |
Fix mod_ldap to open an existing shared memory file should one
already exist.
PR: 12757
Obtained from:
Submitted by: Scooter Morris <scooter@gene.com>
Reviewed by: Graham Leggett
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98416 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | modules/experimental/util_ldap_cache.c | 11 |
2 files changed, 13 insertions, 2 deletions
@@ -65,6 +65,10 @@ Changes with Apache 2.1.0-dev Changes with Apache 2.0.45 + *) Fix mod_ldap to open an existing shared memory file should one + already exist. PR 12757. [Scooter Morris <scooter@gene.com>, + Graham Leggett] + *) Fix the ulimit command used by apachectl on Tru64. PR 13609. [Joseph Senulis <Joseph.Senulis@dnr.state.wi.us>, Jeff Trawick] diff --git a/modules/experimental/util_ldap_cache.c b/modules/experimental/util_ldap_cache.c index 47b0ff17ae..79fc6bea33 100644 --- a/modules/experimental/util_ldap_cache.c +++ b/modules/experimental/util_ldap_cache.c @@ -66,7 +66,7 @@ #ifdef APU_HAS_LDAP - +#define MODLDAP_SHMEM_CACHE "/tmp/mod_ldap_cache" /* ------------------------------------------------------------------ */ @@ -295,7 +295,14 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize) #if APR_HAS_SHARED_MEMORY apr_status_t result; - result = apr_shm_create(&util_ldap_shm, reqsize, "/tmp/ldap_cache", pool); + result = apr_shm_create(&util_ldap_shm, reqsize, MODLDAP_SHMEM_CACHE, pool); + if (result == EEXIST) { + /* + * The cache could have already been created (i.e. we may be a child process). See + * if we can attach to the existing shared memory + */ + result = apr_shm_attach(&util_ldap_shm, MODLDAP_SHMEM_CACHE, pool); + } if (result != APR_SUCCESS) { return result; } |