From: Andrew Bartlett Date: Mon, 9 Apr 2018 19:54:20 +0000 (+1200) Subject: dsdb: Move ldb_set_default_dns() into rootdse_get_private_data() X-Git-Tag: ldb-1.4.0~633 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d37f55cc127cb823821050a333ace8a06f92d2c;p=thirdparty%2Fsamba.git dsdb: Move ldb_set_default_dns() into rootdse_get_private_data() This call needs to be done at the very first chance, in this case during the first call to the lock_read() hook, otherwise the schema_data module can't find the schema. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13379 Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index 0d4cbc60f24..751fe15d1a1 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -867,6 +867,8 @@ static struct rootdse_private_data *rootdse_get_private_data(struct ldb_module * { void *priv = ldb_module_get_private(module); struct rootdse_private_data *data = NULL; + struct ldb_context *ldb + = ldb_module_get_ctx(module); if (priv != NULL) { data = talloc_get_type_abort(priv, @@ -889,6 +891,9 @@ static struct rootdse_private_data *rootdse_get_private_data(struct ldb_module * data->block_anonymous = true; ldb_module_set_private(module, data); + + ldb_set_default_dns(ldb); + return data; } @@ -979,8 +984,6 @@ static int rootdse_init(struct ldb_module *module) return ldb_module_oom(module); } - ldb_set_default_dns(ldb); - ret = ldb_next_init(module); if (ret != LDB_SUCCESS) {