r8982: "name" is not the netbios name, but the RDN. Return the correct
authorAndrew Bartlett <abartlet@samba.org>
Wed, 3 Aug 2005 05:25:30 +0000 (05:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:31:03 +0000 (13:31 -0500)
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)

source4/rpc_server/lsa/dcesrv_lsa.c

index 85f94712ba089f70b013101aa789d8c3ecc25f19..9c5bad30dc10b9e030d3c241ffc6cec88e7f5021 100644 (file)
@@ -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;
 }