You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2014/05/07 14:43:57 UTC

svn commit: r1592991 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS modules/aaa/mod_authn_socache.c

Author: trawick
Date: Wed May  7 12:43:56 2014
New Revision: 1592991

URL: http://svn.apache.org/r1592991
Log:
mod_authn_socache: Fix creation of default socache_instance. Fixes crash
                   on startup if default socache_provider is used and
                   AuthnCacheEnable or AuthnCacheProvideFor is used.
                   This problem has been introduced in r1531961.
                   PR 56371.

Submitted by: jkaluza
Reviewed by: ylavic, jim, trawick

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_socache.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1576233

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1592991&r1=1592990&r2=1592991&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Wed May  7 12:43:56 2014
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.10
 
+  *) mod_authn_socache: Fix crash at startup in certain configurations.
+     PR 56371. (regression in 2.4.7) [Jan Kaluza]
+
   *) mod_lua: Enforce the max post size allowed via r:parsebody()
      [Daniel Gruno]
 

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1592991&r1=1592990&r2=1592991&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Wed May  7 12:43:56 2014
@@ -100,16 +100,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_authn_socache: Fix creation of default socache_instance. Fixes crash
-                        on startup if default socache_provider is used and
-                        AuthnCacheEnable or AuthnCacheProvideFor is used.
-                        This problem has been introduced in r1531961.
-                        PR 56371.
-     Submitted/Committed by: jkaluza
-     trunk patch: http://svn.apache.org/r1576233
-     2.4.x patch: trunk works
-     +1: ylavic, jim, trawick
-
    * mod_proxy_fcgi: Don't crash when connect to the backend fails.
      trunk patch: http://svn.apache.org/r1590437 (and additional CHANGES tweak in r1592500)
      2.4.x patch: trunk patch works other than CHANGES

Modified: httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_socache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_socache.c?rev=1592991&r1=1592990&r2=1592991&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_socache.c (original)
+++ httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_socache.c Wed May  7 12:43:56 2014
@@ -87,6 +87,7 @@ static int authn_cache_post_config(apr_p
 {
     apr_status_t rv;
     static struct ap_socache_hints authn_cache_hints = {64, 32, 60000000};
+    const char *errmsg;
 
     if (!configured) {
         return OK;    /* don't waste the overhead of creating mutex & cache */
@@ -99,6 +100,20 @@ static int authn_cache_post_config(apr_p
         return 500; /* An HTTP status would be a misnomer! */
     }
 
+    /* We have socache_provider, but do not have socache_instance. This should
+     * happen only when using "default" socache_provider, so create default
+     * socache_instance in this case. */
+    if (socache_instance == NULL) {
+        errmsg = socache_provider->create(&socache_instance, NULL,
+                                          ptmp, pconf);
+        if (errmsg) {
+            ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, plog, APLOGNO(02612)
+                        "failed to create mod_socache_shmcb socache "
+                        "instance: %s", errmsg);
+            return 500;
+        }
+    }
+
     rv = ap_global_mutex_create(&authn_cache_mutex, NULL,
                                 authn_cache_id, NULL, s, pconf, 0);
     if (rv != APR_SUCCESS) {