diff options
Diffstat (limited to 'source4/torture/rpc/samr.c')
-rw-r--r-- | source4/torture/rpc/samr.c | 25 |
1 files changed, 24 insertions, 1 deletions
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; } |