From 3e523582ea41702450d2f14535be24ecb45023b7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 18 Jan 2007 01:31:09 +0000 Subject: r20871: implement the validFSMOs constructed attribute on the rootdse for the schema, domain naming and pdc fsmo roles infrastructure and rid manager will be added later, when we have module for them metze (This used to be commit 308f9cf822a3a34dae28a5fa5aa850e2adbeb472) --- source4/dsdb/samdb/ldb_modules/schema_fsmo.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/schema_fsmo.c') diff --git a/source4/dsdb/samdb/ldb_modules/schema_fsmo.c b/source4/dsdb/samdb/ldb_modules/schema_fsmo.c index c692b983dd..deba2b7d88 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_fsmo.c +++ b/source4/dsdb/samdb/ldb_modules/schema_fsmo.c @@ -32,10 +32,6 @@ #include "librpc/gen_ndr/ndr_drsblobs.h" #include "lib/util/dlinklist.h" -struct dsdb_schema_fsmo { - bool we_are_master; -}; - static int schema_fsmo_init(struct ldb_module *module) { WERROR status; @@ -44,7 +40,6 @@ static int schema_fsmo_init(struct ldb_module *module) struct dsdb_schema *schema; struct dsdb_schema_fsmo *schema_fsmo; struct ldb_result *schema_res; - struct ldb_dn *schema_master_dn; const struct ldb_val *prefix_val; const struct ldb_val *info_val; struct ldb_result *a_res; @@ -224,13 +219,20 @@ static int schema_fsmo_init(struct ldb_module *module) return ret; } - schema_master_dn = ldb_msg_find_attr_as_dn(module->ldb, mem_ctx, schema_res->msgs[0], "fSMORoleOwner"); - if (ldb_dn_compare(samdb_ntds_settings_dn(module->ldb), schema_master_dn) == 0) { + schema_fsmo->master_dn = ldb_msg_find_attr_as_dn(module->ldb, schema_fsmo, schema_res->msgs[0], "fSMORoleOwner"); + if (ldb_dn_compare(samdb_ntds_settings_dn(module->ldb), schema_fsmo->master_dn) == 0) { schema_fsmo->we_are_master = true; } else { schema_fsmo->we_are_master = false; } + if (ldb_set_opaque(module->ldb, "dsdb_schema_fsmo", schema_fsmo) != LDB_SUCCESS) { + ldb_oom(module->ldb); + return LDB_ERR_OPERATIONS_ERROR; + } + + talloc_steal(module, schema_fsmo); + ldb_debug(module->ldb, LDB_DEBUG_TRACE, "schema_fsmo_init: we are master: %s\n", (schema_fsmo->we_are_master?"yes":"no")); -- cgit