From 616a48faf94438a5e92538d7a7a9de9cf4fcc6a8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 27 Nov 2007 12:18:23 +0100 Subject: r26165: Add IDL and torture test for wkssvc_NetrGetJoinableOus() and wkssvc_NetrGetJoinableOus2() (both unavailable remotely). Guenther (This used to be commit 256d0a15f50b38aec9505e6431d05c6f715df971) --- source4/librpc/idl/wkssvc.idl | 18 ++++++++-- source4/rpc_server/wkssvc/dcesrv_wkssvc.c | 12 +++---- source4/torture/rpc/wkssvc.c | 55 +++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 8 deletions(-) diff --git a/source4/librpc/idl/wkssvc.idl b/source4/librpc/idl/wkssvc.idl index 564909b96f..56ed4b759d 100644 --- a/source4/librpc/idl/wkssvc.idl +++ b/source4/librpc/idl/wkssvc.idl @@ -516,7 +516,14 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x15 */ - WERROR WKSSVC_NETRGETJOINABLEOUS (); + WERROR wkssvc_NetrGetJoinableOus( + [in] [string,charset(UTF16)] uint16 *server_name, + [in,ref] [string,charset(UTF16)] uint16 *domain_name, + [in] [string,charset(UTF16)] uint16 *Account, + [in] [string,charset(UTF16)] uint16 *unknown, + [in,out,ref] uint32 *num_ous, + [out,ref] [size_is(*num_ous)] [string,charset(UTF16)] uint16 ***ous + ); typedef struct { uint8 data[524]; @@ -591,7 +598,14 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x1a */ - WERROR WKSSVC_NETRGETJOINABLEOUS2 (); + WERROR wkssvc_NetrGetJoinableOus2( + [in] [string,charset(UTF16)] uint16 *server_name, + [in,ref] [string,charset(UTF16)] uint16 *domain_name, + [in] [string,charset(UTF16)] uint16 *Account, + [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,out,ref] uint32 *num_ous, + [out,ref] [size_is(*num_ous)] [string,charset(UTF16)] uint16 ***ous + ); /*****************************/ /* Function 0x1b */ diff --git a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c index ad2b2c63f2..556272afd5 100644 --- a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c +++ b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c @@ -313,10 +313,10 @@ static WERROR dcesrv_wkssvc_NetrGetJoinInformation(struct dcesrv_call_state *dce /* - WKSSVC_NETRGETJOINABLEOUS + wkssvc_NetrGetJoinableOus */ -static WERROR dcesrv_WKSSVC_NETRGETJOINABLEOUS(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct WKSSVC_NETRGETJOINABLEOUS *r) +static WERROR dcesrv_wkssvc_NetrGetJoinableOus(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct wkssvc_NetrGetJoinableOus *r) { DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); } @@ -363,10 +363,10 @@ static WERROR dcesrv_wkssvc_NetrValidateName2(struct dcesrv_call_state *dce_call /* - WKSSVC_NETRGETJOINABLEOUS2 + wkssvc_NetrGetJoinableOus2 */ -static WERROR dcesrv_WKSSVC_NETRGETJOINABLEOUS2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct WKSSVC_NETRGETJOINABLEOUS2 *r) +static WERROR dcesrv_wkssvc_NetrGetJoinableOus2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct wkssvc_NetrGetJoinableOus2 *r) { DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); } diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c index 4ab6b79ce6..f0af7426fd 100644 --- a/source4/torture/rpc/wkssvc.c +++ b/source4/torture/rpc/wkssvc.c @@ -1000,6 +1000,57 @@ static bool test_NetrGetJoinInformation(struct torture_context *tctx, return true; } +static bool test_NetrGetJoinableOus(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + NTSTATUS status; + struct wkssvc_NetrGetJoinableOus r; + uint32_t num_ous = 0; + const char **ous = NULL; + + r.in.server_name = dcerpc_server_name(p); + r.in.domain_name = lp_workgroup(global_loadparm); + r.in.Account = NULL; + r.in.unknown = NULL; + r.in.num_ous = r.out.num_ous = &num_ous; + r.out.ous = &ous; + + torture_comment(tctx, "testing NetrGetJoinableOus\n"); + + status = dcerpc_wkssvc_NetrGetJoinableOus(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "NetrGetJoinableOus failed"); + torture_assert_werr_equal(tctx, r.out.result, + WERR_NOT_SUPPORTED, + "NetrGetJoinableOus failed"); + + return true; +} + +static bool test_NetrGetJoinableOus2(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + NTSTATUS status; + struct wkssvc_NetrGetJoinableOus2 r; + uint32_t num_ous = 0; + const char **ous = NULL; + + r.in.server_name = dcerpc_server_name(p); + r.in.domain_name = lp_workgroup(global_loadparm); + r.in.Account = NULL; + r.in.EncryptedPassword = NULL; + r.in.num_ous = r.out.num_ous = &num_ous; + r.out.ous = &ous; + + torture_comment(tctx, "testing NetrGetJoinableOus2\n"); + + status = dcerpc_wkssvc_NetrGetJoinableOus2(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "NetrGetJoinableOus2 failed"); + torture_assert_werr_equal(tctx, r.out.result, + WERR_RPC_E_REMOTE_DISABLED, + "NetrGetJoinableOus2 failed"); + + return true; +} struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx) { struct torture_suite *suite; @@ -1060,6 +1111,10 @@ struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx) torture_rpc_tcase_add_test(tcase, "NetrGetJoinInformation", test_NetrGetJoinInformation); + torture_rpc_tcase_add_test(tcase, "NetrGetJoinableOus", + test_NetrGetJoinableOus); + torture_rpc_tcase_add_test(tcase, "NetrGetJoinableOus2", + test_NetrGetJoinableOus2); torture_rpc_tcase_add_test(tcase, "NetrWorkstationStatisticsGet", test_NetrWorkstationStatisticsGet); -- cgit