changeset 6620:2a9edc9136f9 HEAD

Master passdbs are in their own list, so allow pass=yes even if a master passdb is the last in the list.
author Timo Sirainen <tss@iki.fi>
date Sat, 27 Oct 2007 18:41:54 +0300
parents 2a36e7d9ddb6
children 744e4f5b6cd0
files src/auth/auth.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth.c	Sat Oct 27 18:31:05 2007 +0300
+++ b/src/auth/auth.c	Sat Oct 27 18:41:54 2007 +0300
@@ -61,8 +61,14 @@
 			masterdb_p = &auth_passdb->next;
 		}
 	}
-	if (auth_passdb != NULL && auth_passdb->pass)
-		i_fatal("Last passdb can't have pass=yes");
+	if (auth_passdb != NULL && auth_passdb->pass) {
+		if (masterdb_p != &auth_passdb->next)
+			i_fatal("Last passdb can't have pass=yes");
+		else if (auth->passdbs == NULL) {
+			i_fatal("Master passdb can't have pass=yes "
+				"if there are no passdbs");
+		}
+	}
 	t_pop();
 
 	t_push();