summaryrefslogtreecommitdiffstats
path: root/source3/groupdb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-28 08:24:28 +0100
committerStefan Metzmacher <metze@samba.org>2008-04-12 09:21:04 +0200
commit37fbe55eea3cbd7fc74ef2da84549eecfa55be8c (patch)
tree3e179c1bfd76eb4ccfeeec12bb6b69ee9105d5d9 /source3/groupdb
parente21b283d6713794fb0a415a9313943867812884d (diff)
downloadsamba-37fbe55eea3cbd7fc74ef2da84549eecfa55be8c.tar.gz
samba-37fbe55eea3cbd7fc74ef2da84549eecfa55be8c.tar.xz
samba-37fbe55eea3cbd7fc74ef2da84549eecfa55be8c.zip
groupdb: readd groupdb:backend parametric option
This reverts c5adb92c020e38644baf1afc8fc570a518cd6307. The reason is that ldb doesn't work for cluster setups yet. metze (This used to be commit 5f5d90ef76b969ecbe564399368a7450c4e3d155)
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 1ddda583df8..ce66bfa64fa 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;
}