summaryrefslogtreecommitdiff
path: root/dfs_server
diff options
context:
space:
mode:
Diffstat (limited to 'dfs_server')
-rw-r--r--dfs_server/dfs_server_ad.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/dfs_server/dfs_server_ad.c b/dfs_server/dfs_server_ad.c
index 249a1d1861..062eb495ec 100644
--- a/dfs_server/dfs_server_ad.c
+++ b/dfs_server/dfs_server_ad.c
@@ -206,14 +206,14 @@ static NTSTATUS get_dcs_insite(TALLOC_CTX *ctx, struct ldb_context *ldb,
for (i = 0; i<r->count; i++) {
struct ldb_dn *dn;
- struct ldb_result *r2;
+ struct ldb_message *msg;
dn = ldb_msg_find_attr_as_dn(ldb, ctx, r->msgs[i], "serverReference");
if (!dn) {
return NT_STATUS_INTERNAL_ERROR;
}
- ret = ldb_search(ldb, r, &r2, dn, LDB_SCOPE_BASE, attrs2, "(objectClass=computer)");
+ ret = dsdb_search_one(ldb, r, &msg, dn, LDB_SCOPE_BASE, attrs2, 0, "(objectClass=computer)");
if (ret != LDB_SUCCESS) {
DEBUG(2,(__location__ ": Search for computer on %s failed - %s\n",
ldb_dn_get_linearized(dn), ldb_errstring(ldb)));
@@ -221,7 +221,7 @@ static NTSTATUS get_dcs_insite(TALLOC_CTX *ctx, struct ldb_context *ldb,
}
if (dofqdn) {
- const char *dns = ldb_msg_find_attr_as_string(r2->msgs[0], "dNSHostName", NULL);
+ const char *dns = ldb_msg_find_attr_as_string(msg, "dNSHostName", NULL);
if (dns == NULL) {
DEBUG(2,(__location__ ": dNSHostName missing on %s\n",
ldb_dn_get_linearized(dn)));
@@ -233,7 +233,7 @@ static NTSTATUS get_dcs_insite(TALLOC_CTX *ctx, struct ldb_context *ldb,
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(list->names[list->count], r);
} else {
char *tmp;
- const char *aname = ldb_msg_find_attr_as_string(r2->msgs[0], "sAMAccountName", NULL);
+ const char *aname = ldb_msg_find_attr_as_string(msg, "sAMAccountName", NULL);
if (aname == NULL) {
DEBUG(2,(__location__ ": sAMAccountName missing on %s\n",
ldb_dn_get_linearized(dn)));
@@ -250,7 +250,7 @@ static NTSTATUS get_dcs_insite(TALLOC_CTX *ctx, struct ldb_context *ldb,
list->names[list->count] = tmp;
}
list->count++;
- talloc_free(r2);
+ talloc_free(msg);
}
talloc_free(r);