diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-07-24 14:26:30 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-07-24 14:26:30 +1000 |
commit | 66f09a7fd121cf7857b45dabc4fcaf32ae543552 (patch) | |
tree | f3dceee89ab41e1a3dc78849c9b57839000c77d3 /source4/torture/rpc/lsa.c | |
parent | 2ecda9fde4aa00aecd6df6ebeb162d173853d146 (diff) | |
parent | 05583308fe8278f1bc0c815e23cf5e470a81e12f (diff) | |
download | samba-66f09a7fd121cf7857b45dabc4fcaf32ae543552.tar.gz samba-66f09a7fd121cf7857b45dabc4fcaf32ae543552.tar.bz2 samba-66f09a7fd121cf7857b45dabc4fcaf32ae543552.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 24309dbf4d9622fcfafa29ef98bc0459fdaa814b)
Diffstat (limited to 'source4/torture/rpc/lsa.c')
-rw-r--r-- | source4/torture/rpc/lsa.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index a4e702f759..e6102f0a82 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -1822,6 +1822,19 @@ static bool test_EnumTrustDom(struct dcerpc_pipe *p, printf("\nTesting EnumTrustDom\n"); + r.in.handle = handle; + r.in.resume_handle = &resume_handle; + r.in.max_size = 0; + r.out.domains = &domains; + r.out.resume_handle = &resume_handle; + + enum_status = dcerpc_lsa_EnumTrustDom(p, mem_ctx, &r); + + if (!(NT_STATUS_EQUAL(enum_status, STATUS_MORE_ENTRIES) || NT_STATUS_EQUAL(enum_status, NT_STATUS_NO_MORE_ENTRIES))) { + printf("EnumTrustDom of zero size failed - %s\n", nt_errstr(enum_status)); + return false; + } + do { r.in.handle = handle; r.in.resume_handle = &resume_handle; @@ -1848,12 +1861,30 @@ static bool test_EnumTrustDom(struct dcerpc_pipe *p, return false; } + if (domains.count == 0) { + printf("EnumTrustDom failed - should have returned 'NT_STATUS_NO_MORE_ENTRIES' for 0 trusted domains\n"); + return false; + } + ret &= test_query_each_TrustDom(p, mem_ctx, handle, &domains); } while ((NT_STATUS_EQUAL(enum_status, STATUS_MORE_ENTRIES))); printf("\nTesting EnumTrustedDomainsEx\n"); + r_ex.in.handle = handle; + r_ex.in.resume_handle = &resume_handle; + r_ex.in.max_size = LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER * 3; + r_ex.out.domains = &domains_ex; + r_ex.out.resume_handle = &resume_handle; + + enum_status = dcerpc_lsa_EnumTrustedDomainsEx(p, mem_ctx, &r_ex); + + if (!(NT_STATUS_EQUAL(enum_status, STATUS_MORE_ENTRIES) || NT_STATUS_EQUAL(enum_status, NT_STATUS_NO_MORE_ENTRIES))) { + printf("EnumTrustedDomainEx of zero size failed - %s\n", nt_errstr(enum_status)); + return false; + } + resume_handle = 0; do { r_ex.in.handle = handle; @@ -1884,6 +1915,11 @@ static bool test_EnumTrustDom(struct dcerpc_pipe *p, return false; } + if (domains_ex.count == 0) { + printf("EnumTrustDomainEx failed - should have returned 'NT_STATUS_NO_MORE_ENTRIES' for 0 trusted domains\n"); + return false; + } + ret &= test_query_each_TrustDomEx(p, mem_ctx, handle, &domains_ex); } while ((NT_STATUS_EQUAL(enum_status, STATUS_MORE_ENTRIES))); @@ -1906,6 +1942,10 @@ static bool test_CreateTrustedDomain(struct dcerpc_pipe *p, printf("Testing CreateTrustedDomain for 12 domains\n"); + if (!test_EnumTrustDom(p, mem_ctx, handle)) { + ret = false; + } + for (i=0; i< 12; i++) { char *trust_name = talloc_asprintf(mem_ctx, "torturedom%02d", i); char *trust_sid = talloc_asprintf(mem_ctx, "S-1-5-21-97398-379795-100%02d", i); |