summaryrefslogtreecommitdiffstats
path: root/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-09-24 23:12:25 -0700
committerMatthieu Patou <mat@matws.net>2012-10-07 21:51:01 -0700
commit3dd2b804b98e232bf9f28a29577f7fdd026a228c (patch)
treeb3268edacb58f319dbabec20bae4546819511fe7 /source4/rpc_server/drsuapi/dcesrv_drsuapi.c
parent899cdc4503696cbe1030f3023fe259ce0740a55c (diff)
downloadsamba-3dd2b804b98e232bf9f28a29577f7fdd026a228c.tar.gz
samba-3dd2b804b98e232bf9f28a29577f7fdd026a228c.tar.xz
samba-3dd2b804b98e232bf9f28a29577f7fdd026a228c.zip
getdcinfo: Check that the server object has a serverreference objects pointing to a DC object
The problem was found by the DRSR testsuite where server objects were created in the Site container without serverrefrence attribute triggering error in the testsuite.
Diffstat (limited to 'source4/rpc_server/drsuapi/dcesrv_drsuapi.c')
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index 4c78738af85..b294e4644ef 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -599,7 +599,7 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_sta
}
ret = ldb_search(b_state->sam_ctx, mem_ctx, &res, sites_dn, LDB_SCOPE_SUBTREE, attrs,
- "objectClass=server");
+ "(&(objectClass=server)(serverReference=*))");
if (ret) {
DEBUG(1, ("searching for servers in sites DN %s failed: %s\n",
@@ -630,7 +630,9 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_sta
}
ret = ldb_search(b_state->sam_ctx, mem_ctx, &res_account, ref_dn,
- LDB_SCOPE_BASE, attrs_account_1, "objectClass=computer");
+ LDB_SCOPE_BASE, attrs_account_1,
+ "(&(objectClass=computer)(userAccountControl:1.2.840.113556.1.4.803:=%u)",
+ UF_SERVER_TRUST_ACCOUNT);
if (ret == LDB_SUCCESS && res_account->count == 1) {
const char *errstr;
ctr1->array[i].dns_name