diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-01-18 01:31:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:43:43 -0500 |
commit | 3e523582ea41702450d2f14535be24ecb45023b7 (patch) | |
tree | ae3bc31a44ff4e27dcf0df7f229fc9ae560cb53d /source4/dsdb/samdb/ldb_modules/rootdse.c | |
parent | 301129f6defacfc924647e6aa7be45cf6d7f2f5b (diff) | |
download | samba-3e523582ea41702450d2f14535be24ecb45023b7.tar.gz samba-3e523582ea41702450d2f14535be24ecb45023b7.tar.bz2 samba-3e523582ea41702450d2f14535be24ecb45023b7.zip |
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)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/rootdse.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/rootdse.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index 9a469c4563..a698e0db43 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -163,6 +163,46 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms } } + if (do_attribute_explicit(attrs, "validFSMOs")) { + const struct dsdb_schema_fsmo *schema_fsmo; + const struct dsdb_naming_fsmo *naming_fsmo; + const struct dsdb_pdc_fsmo *pdc_fsmo; + const char *dn_str; + + schema_fsmo = talloc_get_type(ldb_get_opaque(module->ldb, "dsdb_schema_fsmo"), + struct dsdb_schema_fsmo); + if (schema_fsmo && schema_fsmo->we_are_master) { + dn_str = ldb_dn_get_linearized(samdb_schema_dn(module->ldb)); + if (dn_str && dn_str[0]) { + if (ldb_msg_add_fmt(msg, "validFSMOs", "%s", dn_str) != 0) { + goto failed; + } + } + } + + naming_fsmo = talloc_get_type(ldb_get_opaque(module->ldb, "dsdb_naming_fsmo"), + struct dsdb_naming_fsmo); + if (naming_fsmo && naming_fsmo->we_are_master) { + dn_str = ldb_dn_get_linearized(samdb_partitions_dn(module->ldb, msg)); + if (dn_str && dn_str[0]) { + if (ldb_msg_add_fmt(msg, "validFSMOs", "%s", dn_str) != 0) { + goto failed; + } + } + } + + pdc_fsmo = talloc_get_type(ldb_get_opaque(module->ldb, "dsdb_pdc_fsmo"), + struct dsdb_pdc_fsmo); + if (pdc_fsmo && pdc_fsmo->we_are_master) { + dn_str = ldb_dn_get_linearized(samdb_base_dn(module->ldb)); + if (dn_str && dn_str[0]) { + if (ldb_msg_add_fmt(msg, "validFSMOs", "%s", dn_str) != 0) { + goto failed; + } + } + } + } + /* TODO: lots more dynamic attributes should be added here */ return LDB_SUCCESS; |