summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index 9d1e5968a2..06fa1bba95 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -195,7 +195,47 @@ static NTSTATUS DRSUAPI_GET_NT4_CHANGELOG(struct dcesrv_call_state *dce_call, TA
static NTSTATUS drsuapi_DsCrackNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct drsuapi_DsCrackNames *r)
{
- DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+ struct dcesrv_handle *h;
+
+ r->out.level = r->in.level;
+ ZERO_STRUCT(r->out.out);
+
+ DCESRV_PULL_HANDLE(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE);
+
+ switch (r->in.level) {
+ case 1: {
+ int i;
+
+ r->out.out.info1 = talloc_p(mem_ctx, struct drsuapi_DsCrackNamesOutInfo1);
+ NTSTATUS_TALLOC_CHECK(r->out.out.info1);
+
+ r->out.out.info1->names = talloc_array_p(mem_ctx,
+ struct drsuapi_DsCrackNamesOutInfo1Names,
+ r->in.in.info1.count);
+ NTSTATUS_TALLOC_CHECK(r->out.out.info1->names);
+
+ r->out.out.info1->count = r->in.in.info1.count;
+
+ for (i=0; i < r->out.out.info1->count; i++) {
+ const char *name;
+ r->out.out.info1->names[i].unknown1 = 2;
+ r->out.out.info1->names[i].name1 = NULL;
+ r->out.out.info1->names[i].name2 = NULL;
+
+ /* TODO: fill crack the right names! */
+ name = talloc_asprintf(mem_ctx, "%s/", lp_realm());
+ if (strcmp(name, r->in.in.info1.names[i].str) != 0) {
+ continue;
+ }
+ r->out.out.info1->names[i].unknown1 = 0;
+ r->out.out.info1->names[i].name1 = talloc_asprintf(mem_ctx, "%s", lp_realm());
+ r->out.out.info1->names[i].name2 = talloc_asprintf(mem_ctx, "%s\\", lp_workgroup());
+ }
+ return NT_STATUS_OK;
+ }
+ }
+
+ return NT_STATUS_INVALID_LEVEL;
}