dovecot-1.2: auth: Fixed loading known passdb/userdb plugins.

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 2 00:30:57 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/4aa05d7d8b07
changeset: 8888:4aa05d7d8b07
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 01 17:30:52 2009 -0400
description:
auth: Fixed loading known passdb/userdb plugins.

diffstat:

2 files changed, 14 insertions(+), 2 deletions(-)
src/auth/passdb.c |    8 +++++++-
src/auth/userdb.c |    8 +++++++-

diffs (36 lines):

diff -r 7ddf32656d8c -r 4aa05d7d8b07 src/auth/passdb.c
--- a/src/auth/passdb.c	Wed Apr 01 16:36:56 2009 -0400
+++ b/src/auth/passdb.c	Wed Apr 01 17:30:52 2009 -0400
@@ -25,7 +25,13 @@ static struct passdb_module_interface *p
 
 void passdb_register_module(struct passdb_module_interface *iface)
 {
-	if (passdb_interface_find(iface->name) != NULL) {
+	struct passdb_module_interface *old_iface;
+
+	old_iface = passdb_interface_find(iface->name);
+	if (old_iface != NULL && old_iface->verify_plain == NULL) {
+		/* replacing a "support not compiled in" passdb */
+		passdb_unregister_module(old_iface);
+	} else if (old_iface != NULL) {
 		i_panic("passdb_register_module(%s): Already registered",
 			iface->name);
 	}
diff -r 7ddf32656d8c -r 4aa05d7d8b07 src/auth/userdb.c
--- a/src/auth/userdb.c	Wed Apr 01 16:36:56 2009 -0400
+++ b/src/auth/userdb.c	Wed Apr 01 17:30:52 2009 -0400
@@ -26,7 +26,13 @@ static struct userdb_module_interface *u
 
 void userdb_register_module(struct userdb_module_interface *iface)
 {
-	if (userdb_interface_find(iface->name) != NULL) {
+	struct userdb_module_interface *old_iface;
+
+	old_iface = userdb_interface_find(iface->name);
+	if (old_iface != NULL && old_iface->lookup == NULL) {
+		/* replacing a "support not compiled in" userdb */
+		userdb_unregister_module(old_iface);
+	} else if (old_iface != NULL) {
 		i_panic("userdb_register_module(%s): Already registered",
 			iface->name);
 	}


More information about the dovecot-cvs mailing list