summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-11-27 11:20:34 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:27 +0100
commite6c8fa793994540c224e0f26021e2e3a9c634f22 (patch)
treef405d63f79f07acb733ab6c2157181903e911b84
parent722851c78e0861987488898941c5fa93bbc4d8ce (diff)
downloadsamba-e6c8fa793994540c224e0f26021e2e3a9c634f22.tar.gz
samba-e6c8fa793994540c224e0f26021e2e3a9c634f22.tar.bz2
samba-e6c8fa793994540c224e0f26021e2e3a9c634f22.zip
r26155: Add IDL and torture teset for wkssvc_NetrMessageBufferSend().
Guenther (This used to be commit 9de2f59d2b82b789c99fb82965b37b305c43b8fc)
-rw-r--r--source4/librpc/idl/wkssvc.idl8
-rw-r--r--source4/rpc_server/wkssvc/dcesrv_wkssvc.c8
-rw-r--r--source4/torture/rpc/wkssvc.c32
3 files changed, 43 insertions, 5 deletions
diff --git a/source4/librpc/idl/wkssvc.idl b/source4/librpc/idl/wkssvc.idl
index 918694f011..deb2b54fc0 100644
--- a/source4/librpc/idl/wkssvc.idl
+++ b/source4/librpc/idl/wkssvc.idl
@@ -372,7 +372,13 @@ import "srvsvc.idl", "lsa.idl";
/*****************************/
/* Function 0x0c */
- WERROR WKSSVC_NETRMESSAGEBUFFERSEND ();
+ WERROR wkssvc_NetrMessageBufferSend(
+ [in] [string,charset(UTF16)] uint16 *server_name,
+ [in,ref] [string,charset(UTF16)] uint16 *message_name,
+ [in] [string,charset(UTF16)] uint16 *message_sender_name,
+ [in] [size_is(message_size)] [ref] uint8 *message_buffer,
+ [in] uint32 message_size
+ );
/*****************************/
/* Function 0x0d */
diff --git a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c
index 5d2a88dcfd..5ea0cc73b7 100644
--- a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c
+++ b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c
@@ -222,11 +222,11 @@ static WERROR dcesrv_wkssvc_NetrUseEnum(struct dcesrv_call_state *dce_call, TALL
}
-/*
- WKSSVC_NETRMESSAGEBUFFERSEND
+/*
+ wkssvc_NetrMessageBufferSend
*/
-static WERROR dcesrv_WKSSVC_NETRMESSAGEBUFFERSEND(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
- struct WKSSVC_NETRMESSAGEBUFFERSEND *r)
+static WERROR dcesrv_wkssvc_NetrMessageBufferSend(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+ struct wkssvc_NetrMessageBufferSend *r)
{
DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
}
diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c
index f4141ce32b..98455f50eb 100644
--- a/source4/torture/rpc/wkssvc.c
+++ b/source4/torture/rpc/wkssvc.c
@@ -28,6 +28,7 @@
#define SMBTORTURE_ALTERNATE_NAME "smbtrt_altname"
#define SMBTORTURE_TRANSPORT_NAME "\\Device\\smbtrt_transport_name"
#define SMBTORTURE_USE_NAME "S:"
+#define SMBTORTURE_MESSAGE "smbtrt_message"
static bool test_NetWkstaGetInfo(struct torture_context *tctx,
struct dcerpc_pipe *p)
@@ -740,6 +741,35 @@ static bool test_NetrWorkstationStatisticsGet(struct torture_context *tctx,
return true;
}
+/* only succeeds as long as the local messenger service is running - Guenther */
+
+static bool test_NetrMessageBufferSend(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ NTSTATUS status;
+ struct wkssvc_NetrMessageBufferSend r;
+ const char *message = SMBTORTURE_MESSAGE;
+ size_t size;
+ uint8_t *msg;
+
+ size = push_ucs2_talloc(tctx, (void **)&msg, message);
+
+ r.in.server_name = dcerpc_server_name(p);
+ r.in.message_name = dcerpc_server_name(p);
+ r.in.message_sender_name = dcerpc_server_name(p);
+ r.in.message_buffer = msg;
+ r.in.message_size = size;
+
+ torture_comment(tctx, "testing NetrMessageBufferSend\n");
+
+ status = dcerpc_wkssvc_NetrMessageBufferSend(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status,
+ "NetrMessageBufferSend failed");
+ torture_assert_werr_ok(tctx, r.out.result,
+ "NetrMessageBufferSend failed");
+ return true;
+}
+
struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite;
@@ -790,6 +820,8 @@ struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
torture_rpc_tcase_add_test(tcase, "NetrWorkstationStatisticsGet",
test_NetrWorkstationStatisticsGet);
+ torture_rpc_tcase_add_test(tcase, "NetrMessageBufferSend",
+ test_NetrMessageBufferSend);
return suite;
}