summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-01-14 15:46:32 +1100
committerAndrew Tridgell <tridge@samba.org>2011-01-14 16:39:33 +1100
commit74674e782e9ecb6518bcfb7ca4bb40d44cd63c35 (patch)
tree139abbb77ea3c0c8be1ad89c35fafc53c92c6078 /source4
parent90110a0bbcde7bd8280c005777869609357b79ad (diff)
downloadsamba-74674e782e9ecb6518bcfb7ca4bb40d44cd63c35.tar.gz
samba-74674e782e9ecb6518bcfb7ca4bb40d44cd63c35.tar.bz2
samba-74674e782e9ecb6518bcfb7ca4bb40d44cd63c35.zip
s4-dsdb: removed the last use of samdb_search_*() from the dsdb ldb modules
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c16
1 files changed, 12 insertions, 4 deletions
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;
+ }
+ }
}
}