From 3441f077166ec6c6df0d9eaf337cde2e75643fbe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Apr 2004 06:49:26 +0000 Subject: r259: added samr_DeleteGroupMember() IDL and test code (This used to be commit 747351140b839879abe1a79a005d81ca4b35a658) --- source4/librpc/idl/samr.idl | 5 ++++- source4/torture/rpc/samr.c | 25 ++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index f1fce235a8..6d2b8cfbe6 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -396,7 +396,10 @@ /************************/ /* Function 0x18 */ - NTSTATUS samr_DEL_GROUPMEM(); + NTSTATUS samr_DeleteGroupMember( + [in,ref] policy_handle *handle, + [in] uint32 rid + ); /************************/ /* Function 0x19 */ diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 9930ba8b19..d4e04cda2c 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -1432,6 +1432,7 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_AddGroupMember r; + struct samr_DeleteGroupMember d; BOOL ret = True; uint32 rid; @@ -1444,7 +1445,17 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, r.in.rid = rid; r.in.flags = 0; /* ??? */ - printf("Testing AddGroupMember\n"); + printf("Testing AddGroupMember and DeleteGroupMember\n"); + + d.in.handle = group_handle; + d.in.rid = rid; + + status = dcerpc_samr_DeleteGroupMember(p, mem_ctx, &d); + if (!NT_STATUS_EQUAL(NT_STATUS_MEMBER_NOT_IN_GROUP, status)) { + printf("DeleteGroupMember gave %s - should be NT_STATUS_MEMBER_NOT_IN_GROUP\n", + nt_errstr(status)); + return False; + } status = dcerpc_samr_AddGroupMember(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -1459,6 +1470,18 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + status = dcerpc_samr_DeleteGroupMember(p, mem_ctx, &d); + if (!NT_STATUS_IS_OK(status)) { + printf("DeleteGroupMember failed - %s\n", nt_errstr(status)); + return False; + } + + status = dcerpc_samr_AddGroupMember(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("AddGroupMember failed - %s\n", nt_errstr(status)); + return False; + } + return ret; } -- cgit