httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Darroch <chr...@pearsoncmg.com>
Subject mod_authn_dbd fix?
Date Tue, 29 Aug 2006 06:27:47 GMT
Hi --

   I noticed some recent activity in mod_dbd.c to deal with virtual
host configurations, but didn't pay a lot of attention, I confess.
Today I happened to upgrade a system from 2.2.2 to 2.2.3 and discovered
my AuthDBDUserRealmQuery directives now weren't getting inherited from
the main server config down to the virtual hosts the way they used to.
So, I whipped up this patch -- does it make sense to anyone else?
I'll have to be away from the keyboard for a week, so I won't be
committing anything for a while.  Maybe if someone else (Nick?) could
noodle on this?  Thanks!

Chris.

====================================
--- modules/database/mod_dbd.c.orig	2006-08-29 02:25:54.018358838 -0400
+++ modules/database/mod_dbd.c	2006-08-29 02:16:41.411371370 -0400
@@ -617,10 +617,27 @@
 {
     svr_cfg *svr;
     server_rec *sp;
+    dbd_prepared *main_server_prepared;
     for (sp = s; sp; sp = sp->next) {
         svr = ap_get_module_config(sp->module_config, &dbd_module);
         svr->prepared = apr_hash_get(dbd_prepared_defns, sp->server_hostname,
                                      APR_HASH_KEY_STRING);
+        if (sp == s) {
+            main_server_prepared = svr->prepared;
+        }
+        else if (main_server_prepared != NULL) {
+            if (svr->prepared == NULL) {
+                svr->prepared = main_server_prepared;
+            }
+            else {
+                dbd_prepared *last_prepared = svr->prepared;
+
+                while (last_prepared->next != NULL) {
+                    last_prepared = last_prepared->next;
+                }
+                last_prepared->next = main_server_prepared;
+            }
+        }
     }
     return OK;
 }

Mime
View raw message