]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/ldap/util_ldap.c (util_ldap_post_config): Don't attempt to
authorJoe Orton <jorton@apache.org>
Mon, 1 Aug 2005 14:50:21 +0000 (14:50 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 1 Aug 2005 14:50:21 +0000 (14:50 +0000)
remove the shm segment here.

* modules/ldap/util_ldap_cache.c (util_ldap_cache_init): Properly
remove the shm segment here before creating a new one; don't attach to
any existing shm segment if apr_shm_create() fails.
(util_ldap_cache_module_kill): Don't attempt to remove the shm segment
here; apr_shm_destroy() does that anyway.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@226809 13f79535-47bb-0310-9956-ffa450edef68

modules/ldap/util_ldap.c
modules/ldap/util_ldap_cache.c

index 6703df2ae489108546f61aeb48a128b8a7326a0d..6466a1733dfe0836b11d1ba861039111d936e6e9 100644 (file)
@@ -1817,7 +1817,6 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
         if (st->cache_file) {
             char *lck_file = apr_pstrcat(st->pool, st->cache_file, ".lck", 
                                          NULL);
-            apr_file_remove(st->cache_file, ptemp);
             apr_file_remove(lck_file, ptemp);
         }
 #endif
index 62099748ef8ba9a66a7225269dee21b2d3641113..f4efde021662e25fbfac6592a89f695b5c5fedc2 100644 (file)
@@ -391,9 +391,6 @@ static apr_status_t util_ldap_cache_module_kill(void *data)
     if (st->cache_shm != NULL) {
         apr_status_t result = apr_shm_destroy(st->cache_shm);
         st->cache_shm = NULL;
-        if (st->cache_file) {
-            apr_file_remove(st->cache_file, st->pool);
-        }
         return result;
     }
 #endif
@@ -406,16 +403,12 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
     apr_status_t result;
     apr_size_t size;
 
+    /* Remove any existing shm segment with this name. */
+    apr_shm_remove(st->cache_file, st->pool);
+
     size = APR_ALIGN_DEFAULT(st->cache_bytes);
 
     result = apr_shm_create(&st->cache_shm, size, st->cache_file, st->pool);
-    if (result == APR_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(&st->cache_shm, st->cache_file, st->pool);
-    } 
     if (result != APR_SUCCESS) {
         return result;
     }