summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-12-27 02:01:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:15 -0500
commitea4c64388bb00f41a083fb37a2689ae09f33399b (patch)
tree56de055237bc370cad736a1861a0f2cf0148ac96 /source4/rpc_server
parentf9dd1d7ef8ff30fcf21c08701a3fb95056f2b181 (diff)
downloadsamba-ea4c64388bb00f41a083fb37a2689ae09f33399b.tar.gz
samba-ea4c64388bb00f41a083fb37a2689ae09f33399b.tar.bz2
samba-ea4c64388bb00f41a083fb37a2689ae09f33399b.zip
r20353: Restructure the DRSUAPI DsGetDomainControllerInfo test, because as
usual things are more complex than they appear. Also remove the incorrect server-side implementation, which blindly assumed some sense of consistancy across the API switch levels. Andrew Bartlett (This used to be commit 79941adbff843f5027dacd31b972deca4a1557ec)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index dd26145522..eaf2c65919 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -374,7 +374,6 @@ static WERROR drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_state *b_s
struct ldb_dn *sites_dn;
struct ldb_result *res;
- const char *attrs_account_01[] = { "samAccountName", NULL };
const char *attrs_account_1[] = { "cn", "dnsHostName", NULL };
const char *attrs_account_2[] = { "cn", "dnsHostName", "objectGUID", NULL };
@@ -384,12 +383,10 @@ static WERROR drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_state *b_s
const char *attrs_ntds[] = { "options", "objectGUID", NULL };
- const char *attrs_01[] = { "serverReference", NULL };
const char *attrs_1[] = { "serverReference", "cn", "dnsHostName", NULL };
const char *attrs_2[] = { "serverReference", "cn", "dnsHostName", "objectGUID", NULL };
const char **attrs;
- struct drsuapi_DsGetDCInfoCtr01 *ctr01;
struct drsuapi_DsGetDCInfoCtr1 *ctr1;
struct drsuapi_DsGetDCInfoCtr2 *ctr2;
@@ -408,8 +405,8 @@ static WERROR drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_state *b_s
switch (r->out.level_out) {
case -1:
- attrs = attrs_01;
- break;
+ /* this level is not like the others */
+ return WERR_UNKNOWN_LEVEL;
case 1:
attrs = attrs_1;
break;
@@ -428,29 +425,6 @@ static WERROR drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_state *b_s
}
switch (r->out.level_out) {
- case -1:
- ctr01 = &r->out.ctr.ctr01;
- ctr01->count = res->count;
- ctr01->array = talloc_zero_array(mem_ctx,
- struct drsuapi_DsGetDCInfo01,
- res->count);
- for (i=0; i < res->count; i++) {
- struct ldb_result *res_account;
- struct ldb_dn *ref_dn
- = ldb_msg_find_attr_as_dn(b_state->sam_ctx,
- mem_ctx, res->msgs[i],
- "serverReference");
- ret = ldb_search_exp_fmt(b_state->sam_ctx, mem_ctx, &res_account, ref_dn,
- LDB_SCOPE_BASE, attrs_account_01, "objectClass=computer");
- if (ret) {
- return WERR_GENERAL_FAILURE;
- }
- if (res_account->count == 1) {
- ctr01->array[i].server_nt4_account
- = ldb_msg_find_attr_as_string(res_account->msgs[0], "samAccountName", NULL);
- }
- }
- break;
case 1:
ctr1 = &r->out.ctr.ctr1;
ctr1->count = res->count;