summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-08-03 05:25:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:03 -0500
commit639a8afce30037386055c7b18a49c7f1f5392168 (patch)
tree3b02c223f990d8c2db94084a0aa49e3a9aabb7e2
parent64cdbaf8f118b0cd6e8e9ce387a75dd9f374b58c (diff)
downloadsamba-639a8afce30037386055c7b18a49c7f1f5392168.tar.gz
samba-639a8afce30037386055c7b18a49c7f1f5392168.tar.bz2
samba-639a8afce30037386055c7b18a49c7f1f5392168.zip
r8982: "name" is not the netbios name, but the RDN. Return the correct
netbios domain name of the host, as well as the sid from the cache we fetched earlier. Andrew Bartlett (This used to be commit c847ca2cc8244a7ce4180d17397723a486bbecc8)
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 85f94712ba..9c5bad30dc 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -360,17 +360,8 @@ static NTSTATUS lsa_OpenPolicy(struct dcesrv_call_state *dce_call, TALLOC_CTX *m
static NTSTATUS lsa_info_AccountDomain(struct lsa_policy_state *state, TALLOC_CTX *mem_ctx,
struct lsa_DomainInfo *info)
{
- const char * const attrs[] = { "objectSid", "name", NULL};
- int ret;
- struct ldb_message **res;
-
- ret = gendb_search_dn(state->sam_ldb, mem_ctx, state->domain_dn, &res, attrs);
- if (ret != 1) {
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
- }
-
- info->name.string = samdb_result_string(res[0], "name", NULL);
- info->sid = samdb_result_dom_sid(mem_ctx, res[0], "objectSid");
+ info->name.string = state->domain_name;
+ info->sid = state->domain_sid;
return NT_STATUS_OK;
}
@@ -390,11 +381,11 @@ static NTSTATUS lsa_info_DNS(struct lsa_policy_state *state, TALLOC_CTX *mem_ctx
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- info->name.string = samdb_result_string(res[0], "name", NULL);
+ info->name.string = state->domain_name;
+ info->sid = state->domain_sid;
info->dns_domain.string = samdb_result_string(res[0], "dnsDomain", NULL);
info->dns_forest.string = samdb_result_string(res[0], "dnsDomain", NULL);
info->domain_guid = samdb_result_guid(res[0], "objectGUID");
- info->sid = samdb_result_dom_sid(mem_ctx, res[0], "objectSid");
return NT_STATUS_OK;
}