Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 24235 invoked from network); 5 Aug 2005 14:07:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Aug 2005 14:07:05 -0000 Received: (qmail 53966 invoked by uid 500); 5 Aug 2005 14:07:04 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 53921 invoked by uid 500); 5 Aug 2005 14:07:04 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 53898 invoked by uid 99); 5 Aug 2005 14:07:04 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 05 Aug 2005 07:06:53 -0700 Received: (qmail 24188 invoked by uid 65534); 5 Aug 2005 14:06:51 -0000 Message-ID: <20050805140651.24187.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r230474 - in /httpd/httpd/branches/2.0.x: CHANGES STATUS modules/experimental/util_ldap_cache.c Date: Fri, 05 Aug 2005 14:06:50 -0000 To: cvs@httpd.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.3 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jorton Date: Fri Aug 5 07:06:46 2005 New Revision: 230474 URL: http://svn.apache.org/viewcvs?rev=230474&view=rev Log: Merge r225753 from trunk: * modules/ldap/util_ldap_cache.c (util_ldap_cache_init): Use the actual available size of the shm segment not the requested size. Ensure the requested size is aligned. Check errors from apr_rmm_init. Reviewed by: jorton, minfrin, bnicholes Modified: httpd/httpd/branches/2.0.x/CHANGES httpd/httpd/branches/2.0.x/STATUS httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache.c Modified: httpd/httpd/branches/2.0.x/CHANGES URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/CHANGES?rev=230474&r1=230473&r2=230474&view=diff ============================================================================== --- httpd/httpd/branches/2.0.x/CHANGES [utf-8] (original) +++ httpd/httpd/branches/2.0.x/CHANGES [utf-8] Fri Aug 5 07:06:46 2005 @@ -4,7 +4,7 @@ *) mod_proxy: Fix over-eager handling of '%' for reverse proxies. PR 15207. [Jim Jagielski] - *) mod_ldap: Fix a possible crash in shared memory cache handling. + *) mod_ldap: Fix various shared memory cache handling bugs. PR 34209. [Joe Orton] *) Fix a file descriptor leak when starting piped loggers. PR 33748. Modified: httpd/httpd/branches/2.0.x/STATUS URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/STATUS?rev=230474&r1=230473&r2=230474&view=diff ============================================================================== --- httpd/httpd/branches/2.0.x/STATUS (original) +++ httpd/httpd/branches/2.0.x/STATUS Fri Aug 5 07:06:46 2005 @@ -370,11 +370,6 @@ http://svn.apache.org/viewcvs.cgi?rev=209539&view=rev +1: pquerna - *) mod_ldap: Use the correct shm segment size, fail on - apr_rmm_init errors. - http://svn.apache.org/viewcvs?rev=225753&view=rev - +1: jorton, minfrin, bnicholes - *) mod_ldap: Initialize mutex permissions properly so that locking actually works. http://svn.apache.org/viewcvs?rev=105412&view=rev Modified: httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache.c URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache.c?rev=230474&r1=230473&r2=230474&view=diff ============================================================================== --- httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache.c (original) +++ httpd/httpd/branches/2.0.x/modules/experimental/util_ldap_cache.c Fri Aug 5 07:06:46 2005 @@ -397,8 +397,11 @@ { #if APR_HAS_SHARED_MEMORY apr_status_t result; + apr_size_t size; - result = apr_shm_create(&st->cache_shm, st->cache_bytes, 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 @@ -410,8 +413,17 @@ return result; } + /* Determine the usable size of the shm segment. */ + size = apr_shm_size_get(st->cache_shm); + /* This will create a rmm "handler" to get into the shared memory area */ - apr_rmm_init(&st->cache_rmm, NULL, (void *)apr_shm_baseaddr_get(st->cache_shm), st->cache_bytes, st->pool); + result = apr_rmm_init(&st->cache_rmm, NULL, + apr_shm_baseaddr_get(st->cache_shm), size, + st->pool); + if (result != APR_SUCCESS) { + return result; + } + #endif apr_pool_cleanup_register(st->pool, st , util_ldap_cache_module_kill, apr_pool_cleanup_null);