From 5d7f0dec9e4eb14fa792e0218b0571ba779bbf59 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Sep 2004 07:32:01 +0000 Subject: r2465: modify the autoidl hack to work for DRSUAPI (This used to be commit 59b3d68bd047231d72fa3299e7289aef25702e9b) --- source4/torture/rpc/autoidl.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/autoidl.c b/source4/torture/rpc/autoidl.c index d05390cb5a..a0d36ecc86 100644 --- a/source4/torture/rpc/autoidl.c +++ b/source4/torture/rpc/autoidl.c @@ -23,8 +23,31 @@ #include "includes.h" +#if 1 /* - get a handle - doesn't really matter what type + get a DRSUAPI policy handle +*/ +static BOOL get_policy_handle(struct dcerpc_pipe *p, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct drsuapi_Bind r; + + ZERO_STRUCT(r); + r.out.handle = handle; + + status = dcerpc_drsuapi_Bind(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("drsuapi_Bind failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} +#else +/* + get a SAMR handle */ static BOOL get_policy_handle(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) @@ -44,6 +67,7 @@ static BOOL get_policy_handle(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +#endif static void fill_blob_handle(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct policy_handle *handle) @@ -227,7 +251,7 @@ static void test_scan_call(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_ta static void test_auto_scan(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_table *iface) { - test_scan_call(mem_ctx, iface, 0x42); + test_scan_call(mem_ctx, iface, 2); } BOOL torture_rpc_autoidl(int dummy) @@ -235,7 +259,7 @@ BOOL torture_rpc_autoidl(int dummy) TALLOC_CTX *mem_ctx; const struct dcerpc_interface_table *iface; - iface = idl_iface_by_name("samr"); + iface = idl_iface_by_name("drsuapi"); if (!iface) { printf("Unknown interface!\n"); return False; -- cgit