From 74674e782e9ecb6518bcfb7ca4bb40d44cd63c35 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 14 Jan 2011 15:46:32 +1100 Subject: s4-dsdb: removed the last use of samdb_search_*() from the dsdb ldb modules Pair-Programmed-With: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/rootdse.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index 2571bc3c8b..2c0fcfcdd1 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -202,10 +202,18 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_message *ms } if (do_attribute(attrs, "dnsHostName")) { - if (ldb_msg_add_string(msg, "dnsHostName", - samdb_search_string(ldb, msg, samdb_server_dn(ldb, msg), - "dNSHostName", NULL)) != LDB_SUCCESS) { - goto failed; + struct ldb_result *res; + int ret; + const char *dns_attrs[] = { "dNSHostName", NULL }; + ret = dsdb_module_search_dn(module, msg, &res, samdb_server_dn(ldb, msg), + dns_attrs, DSDB_FLAG_NEXT_MODULE); + if (ret == LDB_SUCCESS) { + const char *hostname = ldb_msg_find_attr_as_string(res->msgs[0], "dNSHostName", NULL); + if (hostname != NULL) { + if (ldb_msg_add_string(msg, "dNSHostName", hostname)) { + goto failed; + } + } } } -- cgit