You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ni...@apache.org on 2010/07/01 00:02:41 UTC

svn commit: r959455 - /httpd/httpd/trunk/modules/aaa/mod_authn_socache.c

Author: niq
Date: Wed Jun 30 22:02:41 2010
New Revision: 959455

URL: http://svn.apache.org/viewvc?rev=959455&view=rev
Log:
Extra robustness check: don't segfault if no socache provider selected
and there's no compile-time default.

Modified:
    httpd/httpd/trunk/modules/aaa/mod_authn_socache.c

Modified: httpd/httpd/trunk/modules/aaa/mod_authn_socache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authn_socache.c?rev=959455&r1=959454&r2=959455&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authn_socache.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authn_socache.c Wed Jun 30 22:02:41 2010
@@ -87,6 +87,13 @@ static int authn_cache_post_config(apr_p
     const char *errmsg;
     static struct ap_socache_hints authn_cache_hints = {64, 32, 60000000};
 
+    if (socache_provider == NULL) {
+        ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, plog,
+                      "Please select a socache provider with AuthnCacheSOCache "
+                      "(no default found on this platform)");
+        return 500; /* An HTTP status would be a misnomer! */
+    }
+
     rv = ap_global_mutex_create(&authn_cache_mutex, NULL,
                                 authn_cache_id, NULL, s, pconf, 0);
     if (rv != APR_SUCCESS) {