summaryrefslogtreecommitdiff
path: root/source4/rpc_server/drsuapi
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server/drsuapi')
-rw-r--r--source4/rpc_server/drsuapi/drsuapi_cracknames.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source4/rpc_server/drsuapi/drsuapi_cracknames.c b/source4/rpc_server/drsuapi/drsuapi_cracknames.c
index f915c8a1b6..e9b78b184b 100644
--- a/source4/rpc_server/drsuapi/drsuapi_cracknames.c
+++ b/source4/rpc_server/drsuapi/drsuapi_cracknames.c
@@ -58,18 +58,19 @@ static WERROR DsCrackNameOneName(struct drsuapi_bind_state *b_state, TALLOC_CTX
case DRSUAPI_DS_NAME_FORMAT_CANONICAL: {
char *str;
- str = talloc_asprintf(mem_ctx, "%s/", lp_realm());
+ str = talloc_strdup(mem_ctx, name);
WERR_TALLOC_CHECK(str);
-
- ret = strcasecmp(str, name);
- talloc_free(str);
- if (ret != 0) {
- info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
+
+ if (strlen(str) == 0 || str[strlen(str)-1] != '/') {
+ info1->status = DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
return WERR_OK;
}
+
+ str[strlen(str)-1] = '\0';
- domain_filter = talloc_asprintf(mem_ctx, "(&(objectClass=domainDNS)(name=%s))",
- lp_workgroup());
+ domain_filter = talloc_asprintf(mem_ctx,
+ "(&(&(&(dnsRoot=%s)(objectclass=crossRef)))(nETBIOSName=*)(ncName=*))",
+ str);
WERR_TALLOC_CHECK(domain_filter);
break;