diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-11-25 18:49:42 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-25 19:19:32 +1100 |
commit | c16e96e46f5301a7fe897ed0451fd4bb788fee14 (patch) | |
tree | 1757c34062e20fc1603537b5093d68cd23ff228a /source4/dsdb/samdb/ldb_modules | |
parent | 7de2a49f28f6d9fa26e004cf15f4756397d0ea07 (diff) | |
download | samba-c16e96e46f5301a7fe897ed0451fd4bb788fee14.tar.gz samba-c16e96e46f5301a7fe897ed0451fd4bb788fee14.tar.bz2 samba-c16e96e46f5301a7fe897ed0451fd4bb788fee14.zip |
s4:dsdb Make samba_dsdb easier to use in upgrades - assume default values
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samba_dsdb.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c index d561780569..ee7e42ef9b 100644 --- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c +++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c @@ -237,14 +237,17 @@ static int samba_dsdb_init(struct ldb_module *module) } while (0) ret = dsdb_module_search_dn(module, tmp_ctx, &res, samba_dsdb_dn, samba_dsdb_attrs, 0); - if (ret != LDB_SUCCESS) { + if (ret == LDB_ERR_NO_SUCH_OBJECT) { + backendType = "ldb"; + serverRole = "domain controller"; + } else if (ret == LDB_SUCCESS) { + backendType = ldb_msg_find_attr_as_string(res->msgs[0], "backendType", "ldb"); + serverRole = ldb_msg_find_attr_as_string(res->msgs[0], "serverRole", "domain controller"); + } else { talloc_free(tmp_ctx); return ret; } - backendType = ldb_msg_find_attr_as_string(res->msgs[0], "backendType", "ldb"); - serverRole = ldb_msg_find_attr_as_string(res->msgs[0], "serverRole", NULL); - backend_modules = NULL; if (strcasecmp(backendType, "ldb") == 0) { if (strcasecmp(serverRole, "dc") == 0 || strcasecmp(serverRole, "domain controller") == 0) { |