summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/drsuapi.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index 907183083b..aed7f884d2 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -48,6 +48,40 @@ static BOOL test_DsBind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
+static BOOL test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *bind_handle)
+{
+ NTSTATUS status;
+ struct drsuapi_DsCrackNames r;
+ struct drsuapi_DsCrackNamesInInfo1Names names[1];
+ BOOL ret = True;
+
+ ZERO_STRUCT(r);
+ r.in.bind_handle = bind_handle;
+ r.in.level = 1;
+ r.in.in.info1.unknown1 = 0x000004e4;
+ r.in.in.info1.unknown2 = 0x00000407;
+ r.in.in.info1.unknown3 = 0x00000000;
+ r.in.in.info1.unknown4 = 0x00000007;
+ r.in.in.info1.unknown5 = 0x00000002;
+ r.in.in.info1.count = 1;
+ r.in.in.info1.names = names;
+
+ names[0].str = talloc_asprintf(mem_ctx, "%s/", lp_realm());
+
+ status = dcerpc_drsuapi_DsCrackNames(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ const char *errstr = nt_errstr(status);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
+ errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
+ }
+ printf("drsuapi_DsCrackNames failed - %s\n", errstr);
+ ret = False;
+ }
+
+ return ret;
+}
+
static BOOL test_DsUnbind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *bind_handle)
{
@@ -95,6 +129,10 @@ BOOL torture_rpc_drsuapi(int dummy)
ret = False;
}
+ if (!test_DsCrackNames(p, mem_ctx, &bind_handle)) {
+ ret = False;
+ }
+
if (!test_DsUnbind(p, mem_ctx, &bind_handle)) {
ret = False;
}