diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-04-23 04:21:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:33 -0500 |
commit | 493a37ba663686b7bee3f7093d6650a24250f101 (patch) | |
tree | abcf06347f09b6468848308edce37f8ad28379b4 /source4/torture | |
parent | 1793845e08dafa2566d8713cbf21adcda1641f0f (diff) | |
download | samba-493a37ba663686b7bee3f7093d6650a24250f101.tar.gz samba-493a37ba663686b7bee3f7093d6650a24250f101.tar.bz2 samba-493a37ba663686b7bee3f7093d6650a24250f101.zip |
r335: added much better handling of servers that die unexpectedly during a
request (a dead socket). I discovered this when testing against Sun's
PC-NetLink.
cleaned up the naming of some of the samr requests
add IDL and test code for samr_QueryGroupMember(),
samr_SetMemberAttributesOfGroup() and samr_Shutdown(). (actually, I
didn't leave the samr_Shutdown() test in, as its fatal to windows
servers due to doing exactly what it says it does).
(This used to be commit 925bc2622c105dee4ffff809c6c35cd209a839f8)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/autoidl.c | 7 | ||||
-rw-r--r-- | source4/torture/rpc/samr.c | 37 |
2 files changed, 36 insertions, 8 deletions
diff --git a/source4/torture/rpc/autoidl.c b/source4/torture/rpc/autoidl.c index ae4126688f..6021f10c49 100644 --- a/source4/torture/rpc/autoidl.c +++ b/source4/torture/rpc/autoidl.c @@ -112,6 +112,11 @@ static void try_expand(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_table insert_ofs, insert_ofs+n, depth+1); } return; + } else { +#if 0 + print_depth(depth); + printf("expand by %d gives fault 0x%x\n", n, p->last_fault_code); +#endif } if (p->last_fault_code == 5) { reopen(&p, iface); @@ -222,7 +227,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, 0x41); + test_scan_call(mem_ctx, iface, 0x26); } BOOL torture_rpc_autoidl(int dummy) diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 95d21e20e4..7433627743 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -701,30 +701,30 @@ static BOOL test_AddMemberToAlias(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const struct dom_sid *domain_sid) { - struct samr_AddAliasMem r; - struct samr_DelAliasMem d; + struct samr_AddAliasMember r; + struct samr_DeleteAliasMember d; NTSTATUS status; BOOL ret = True; struct dom_sid *sid; sid = dom_sid_add_rid(mem_ctx, domain_sid, 512); - printf("testing AddAliasMem\n"); + printf("testing AddAliasMember\n"); r.in.handle = alias_handle; r.in.sid = sid; - status = dcerpc_samr_AddAliasMem(p, mem_ctx, &r); + status = dcerpc_samr_AddAliasMember(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - printf("AddAliasMem failed - %s\n", nt_errstr(status)); + printf("AddAliasMember failed - %s\n", nt_errstr(status)); ret = False; } d.in.handle = alias_handle; d.in.sid = sid; - status = dcerpc_samr_DelAliasMem(p, mem_ctx, &d); + status = dcerpc_samr_DeleteAliasMember(p, mem_ctx, &d); if (!NT_STATUS_IS_OK(status)) { - printf("DelAliasMem failed - %s\n", nt_errstr(status)); + printf("DelAliasMember failed - %s\n", nt_errstr(status)); ret = False; } @@ -2177,6 +2177,8 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, NTSTATUS status; struct samr_AddGroupMember r; struct samr_DeleteGroupMember d; + struct samr_QueryGroupMember q; + struct samr_SetMemberAttributesOfGroup s; BOOL ret = True; uint32 rid; @@ -2214,6 +2216,25 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + /* this one is quite strange. I am using random inputs in the + hope of triggering an error that might give us a clue */ + s.in.handle = group_handle; + s.in.unknown1 = random(); + s.in.unknown2 = random(); + + status = dcerpc_samr_SetMemberAttributesOfGroup(p, mem_ctx, &s); + if (!NT_STATUS_IS_OK(status)) { + printf("SetMemberAttributesOfGroup failed - %s\n", nt_errstr(status)); + return False; + } + + q.in.handle = group_handle; + + status = dcerpc_samr_QueryGroupMember(p, mem_ctx, &q); + if (!NT_STATUS_IS_OK(status)) { + printf("QueryGroupMember failed - %s\n", nt_errstr(status)); + return False; + } status = dcerpc_samr_DeleteGroupMember(p, mem_ctx, &d); if (!NT_STATUS_IS_OK(status)) { @@ -2319,6 +2340,8 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ZERO_STRUCT(user_handle); ZERO_STRUCT(alias_handle); + ZERO_STRUCT(group_handle); + ZERO_STRUCT(domain_handle); printf("Testing OpenDomain\n"); |