struct ldb_message *msg, *module_msg;
struct ldb_result *res;
struct ldb_context *ldb = ldb_module_get_ctx(module);
- const char *attrs[] = { "partition", "replicateEntries", "modules", "ldapBackend",
+ const char *attrs[] = { "partition", "replicateEntries", "modules",
"partialReplica", "backendStore", NULL };
/* perform search for @PARTITION, looking for module, replicateEntries and ldapBackend */
ret = dsdb_module_search_dn(module, mem_ctx, &res,
return ret;
}
- data->ldapBackend = talloc_steal(data, ldb_msg_find_attr_as_string(msg, "ldapBackend", NULL));
if (_msg) {
*_msg = msg;
} else {
struct dsdb_partition **partition) {
struct dsdb_control_current_partition *ctrl;
struct ldb_module *backend_module;
+ char *backend_path;
struct ldb_module *module_chain;
const char **modules;
const char **options = NULL;
return ldb_oom(ldb);
}
- /* See if an LDAP backend has been specified */
- if (data->ldapBackend) {
- (*partition)->backend_url = data->ldapBackend;
- } else {
- /* the backend LDB is the DN (base64 encoded if not 'plain') followed by .ldb */
- char *backend_path = ldb_relative_path(ldb,
- *partition,
- filename);
- if (!backend_path) {
- ldb_asprintf_errstring(ldb,
- "partition_init: unable to determine an relative path for partition: %s", filename);
- talloc_free(*partition);
- return LDB_ERR_OPERATIONS_ERROR;
- }
- (*partition)->backend_url = talloc_asprintf(*partition, "%s://%s",
- backend_db_store,
- backend_path);
-
- if (!(ldb_module_flags(ldb) & LDB_FLG_RDONLY)) {
- char *p;
- char *backend_dir;
+ /* the backend LDB is the DN (base64 encoded if not 'plain') followed by .ldb */
+ backend_path = ldb_relative_path(ldb,
+ *partition,
+ filename);
+ if (!backend_path) {
+ ldb_asprintf_errstring(ldb,
+ "partition_init: unable to determine an relative path for partition: %s",
+ filename);
+ talloc_free(*partition);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ (*partition)->backend_url = talloc_asprintf(*partition, "%s://%s",
+ backend_db_store,
+ backend_path);
- p = strrchr(backend_path, '/');
- if (p) {
- p[0] = '\0';
- }
- backend_dir = backend_path;
+ if (!(ldb_module_flags(ldb) & LDB_FLG_RDONLY)) {
+ char *p;
+ char *backend_dir;
- /* Failure is quite reasonable, it might alredy exist */
- mkdir(backend_dir, 0700);
+ p = strrchr(backend_path, '/');
+ if (p) {
+ p[0] = '\0';
}
+ backend_dir = backend_path;
+ /* Failure is quite reasonable, it might alredy exist */
+ mkdir(backend_dir, 0700);
}
ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
talloc_free(partition->ctrl->dn);
partition->ctrl->dn = talloc_steal(partition->ctrl, dn_res->msgs[0]->dn);
talloc_free(dn_res);
- if (data->ldapBackend) {
- ret = dsdb_fix_dn_rdncase(ldb, partition->ctrl->dn);
- if (ret) {
- talloc_free(mem_ctx);
- return ret;
- }
- }
} else if (ret != LDB_ERR_NO_SUCH_OBJECT) {
ldb_asprintf_errstring(ldb,
"Failed to search for partition base %s in new partition at %s: %s",