summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 1ddda583df..ce66bfa64f 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -30,12 +30,30 @@ static const struct mapping_backend *backend;
*/
static bool init_group_mapping(void)
{
+ const char *backend_string;
+
if (backend != NULL) {
/* already initialised */
return True;
}
-
- backend = groupdb_ldb_init();
+
+ /*
+ * default to using the ldb backend. This parameter should
+ * disappear in future versions of Samba3.
+ *
+ * But it's needed for cluster setups, because it's
+ * not yet possible to distribute a ldb inside a cluster.
+ */
+ backend_string = lp_parm_const_string(-1, "groupdb", "backend", "ldb");
+
+ if (strcmp(backend_string, "ldb") == 0) {
+ backend = groupdb_ldb_init();
+ } else if (strcmp(backend_string, "tdb") == 0) {
+ backend = groupdb_tdb_init();
+ } else {
+ DEBUG(0,("Unknown groupdb backend '%s'\n", backend_string));
+ smb_panic("Unknown groupdb backend");
+ }
return backend != NULL;
}