diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-07 03:11:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:29 -0500 |
commit | 4ea89e5cf9f5e5b31434b2cfcbb6cdf853ee410f (patch) | |
tree | 693f877fb70d09bcfb6dcabd2f42d9612b8e0e68 | |
parent | ad7da47948a5a3ed2c3fc18392b83c059bec5b6e (diff) | |
download | samba-4ea89e5cf9f5e5b31434b2cfcbb6cdf853ee410f.tar.gz samba-4ea89e5cf9f5e5b31434b2cfcbb6cdf853ee410f.tar.bz2 samba-4ea89e5cf9f5e5b31434b2cfcbb6cdf853ee410f.zip |
r4585: don't consider LookupSids3 failing with NT_STATUS_ACCESS_DENIED (as w2k3 does) or
NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED (as longhorn does) to be an error.
fixed the CreateTrustedDomain test to cope with the "torturedomain" being left over
from a previous aborted run
(This used to be commit 429d79815c260781fae6eed28160d7507e780f34)
-rw-r--r-- | source4/torture/rpc/lsa.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 5e0d75f7b5..84f56fed71 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -342,7 +342,13 @@ static BOOL test_LookupSids3(struct dcerpc_pipe *p, status = dcerpc_lsa_LookupSids3(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) { - printf("LookupSids3 failed - %s\n", nt_errstr(status)); + if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) || + NT_STATUS_EQUAL(status, NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED)) { + printf("not considering %s to be an error\n", nt_errstr(status)); + return True; + } + printf("LookupSids3 failed - %s - not considered an error\n", + nt_errstr(status)); return False; } @@ -596,6 +602,33 @@ static BOOL test_CreateAccount(struct dcerpc_pipe *p, return True; } +static BOOL test_DeleteTrustedDomain(struct dcerpc_pipe *p, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + struct lsa_String name) +{ + NTSTATUS status; + struct lsa_OpenTrustedDomainByName r; + struct policy_handle trustdom_handle; + + r.in.handle = handle; + r.in.name = name; + r.in.access_mask = SEC_STD_DELETE; + r.out.trustdom_handle = &trustdom_handle; + + status = dcerpc_lsa_OpenTrustedDomainByName(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("lsa_OpenTrustedDomainByName failed - %s\n", nt_errstr(status)); + return False; + } + + if (!test_Delete(p, mem_ctx, &trustdom_handle)) { + return False; + } + + return True; +} + static BOOL test_CreateTrustedDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, @@ -620,6 +653,10 @@ static BOOL test_CreateTrustedDomain(struct dcerpc_pipe *p, r.out.dom_handle = &dom_handle; status = dcerpc_lsa_CreateTrustedDomain(p, mem_ctx, &r); + if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) { + test_DeleteTrustedDomain(p, mem_ctx, handle, trustinfo.name); + status = dcerpc_lsa_CreateTrustedDomain(p, mem_ctx, &r); + } if (!NT_STATUS_IS_OK(status)) { printf("CreateTrustedDomain failed - %s\n", nt_errstr(status)); return False; |