Commit f716c1f7 authored by Bradley Nicholes's avatar Bradley Nicholes
Browse files

Enable the option to support anonymous shared memory in mod_ldap. This makes...

Enable the option to support anonymous shared memory in mod_ldap. This makes the cache work on Linux again.

Reviewed by: minfrin, bnicholes, trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104402 13f79535-47bb-0310-9956-ffa450edef68
parent a36c64ed
Loading
Loading
Loading
Loading
+3 −0
Changes for CHANGES: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
Changes with Apache 2.0.51
  *) Enable the option to support anonymous shared memory in mod_ldap.
     This makes the cache work on Linux again. [Graham Leggett]
  *) Enable special ErrorDocument value 'default' which restores the
     canned server response for the scope of the directive
     [Geoffrey Young, Andre Malo]
+1 −8
Changes for STATUS: 1 added line, 8 removed lines.
Original line number Diff line number Diff line
APACHE 2.0 STATUS:                                              -*-text-*-
Last modified at [$Date: 2004/07/20 02:25:47 $]
Last modified at [$Date: 2004/07/28 20:05:49 $]

Release:

@@ -141,13 +141,6 @@ PATCHES TO BACKPORT FROM 2.1
         include/util_ldap.h r1.19
       +1: bnicholes
       
    *) Enable the option to support anonymous shared memory in mod_ldap.
       This makes the cache work on Linux again.
         modules/experimental/util_ldap.c r1.30
         modules/experimental/util_ldap_cache.c r1.17
         docs/manual/mod/mod_ldap.xml r1.12
       +1 minfrin, bnicholes, trawick

    *) Prevent Win32 pool corruption at startup
         server/mpm/winnt/child.c: r1.36 
       +1: ake, trawick, nd, stoddard
+3 −2
Changes for docs/manual/mod/mod_ldap.xml: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
<!-- $Revision: 1.3.2.7 $ -->
<!-- $Revision: 1.3.2.8 $ -->

<!--
 Copyright 2002-2004 The Apache Software Foundation
@@ -248,7 +248,8 @@ by other LDAP modules</description>

<usage>
    <p>Specifies the directory path and file name of the shared memory
    cache file. If not set, shared memory caching will not be used.</p>
    cache file. If not set, anonymous shared memory will be used if the
    platform supports it.</p>
</usage>
</directivesynopsis>

+7 −5
Changes for modules/experimental/util_ldap.c: 7 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -1166,13 +1166,15 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
    server_rec *s_vhost;
    util_ldap_state_t *st_vhost;
    
    /* initializing cache if file is here and we already don't have shm addr*/
    if (st->cache_file && !st->cache_shm) {
    /* initializing cache if shared memory size is not zero and we already don't have shm address */
    if (!st->cache_shm && st->cache_bytes > 0) {
#endif
        result = util_ldap_cache_init(p, st);
        if (result != APR_SUCCESS) {
            apr_strerror(result, buf, sizeof(buf));
        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, result, s,
                     "LDAP cache init: %s", buf);
            ap_log_error(APLOG_MARK, APLOG_ERR, result, s,
                         "LDAP cache: error while creating a shared memory segment: %s", buf);
        }

#if APR_HAS_SHARED_MEMORY
        /* merge config in all vhost */
@@ -1190,7 +1192,7 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
        }
    }
    else {
        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0 , s, "LDAP cache: Unable to init Shared Cache: no file");
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "LDAP cache: LDAPSharedCacheSize is zero, disabling shared memory cache");
    }
#endif
    
+1 −5
Changes for modules/experimental/util_ldap_cache.c: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
@@ -267,12 +267,8 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
#if APR_HAS_SHARED_MEMORY
    apr_status_t result;

    if (!st->cache_file) {
    	return -1;
    }

    result = apr_shm_create(&st->cache_shm, st->cache_bytes, st->cache_file, st->pool);
    if (result == EEXIST) {
    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