diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-02-21 13:03:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:43 -0500 |
commit | bf5cfb5f3d7bf315d6869d16fcb061234fef1f92 (patch) | |
tree | d7729bc7905ce19fcc581eca2f76572f773c853c /source4/torture | |
parent | b76461f425fbfe425a7c0773626f53e394b48386 (diff) | |
download | samba-bf5cfb5f3d7bf315d6869d16fcb061234fef1f92.tar.gz samba-bf5cfb5f3d7bf315d6869d16fcb061234fef1f92.tar.bz2 samba-bf5cfb5f3d7bf315d6869d16fcb061234fef1f92.zip |
r21491: Verify that the DNS domain name is filled in on GUID searches in the
RPC-CRACKNAMES test.
Andrew Bartlett
(This used to be commit 7773f23e89340c459a0028a4c36b869d95ed8eb1)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/drsuapi_cracknames.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c index d3ab2e86ee..0cb5b35879 100644 --- a/source4/torture/rpc/drsuapi_cracknames.c +++ b/source4/torture/rpc/drsuapi_cracknames.c @@ -406,6 +406,38 @@ BOOL test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, FQDN_1779_name = r.out.ctr.ctr1->array[0].result_name; + r.in.req.req1.format_offered = DRSUAPI_DS_NAME_FORMAT_GUID; + r.in.req.req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779; + names[0].str = priv->domain_guid_str; + + printf("testing DsCrackNames with name '%s' desired format:%d\n", + names[0].str, r.in.req.req1.format_desired); + + status = dcerpc_drsuapi_DsCrackNames(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + const char *errstr = nt_errstr(status); + if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { + errstr = dcerpc_errstr(mem_ctx, p->last_fault_code); + } + printf("dcerpc_drsuapi_DsCrackNames failed - %s\n", errstr); + ret = False; + } else if (!W_ERROR_IS_OK(r.out.result)) { + printf("DsCrackNames failed - %s\n", win_errstr(r.out.result)); + ret = False; + } else if (r.out.ctr.ctr1->array[0].status != DRSUAPI_DS_NAME_STATUS_OK) { + printf("DsCrackNames failed on name - %d\n", r.out.ctr.ctr1->array[0].status); + ret = False; + } + + if (!ret) { + return ret; + } + + if (strcmp(priv->domain_dns_name, r.out.ctr.ctr1->array[0].dns_domain_name) != 0) { + printf("DsCrackNames failed to return same DNS name - expected %s got %s\n", priv->domain_dns_name, r.out.ctr.ctr1->array[0].dns_domain_name); + return False; + } + FQDN_1779_dn = ldb_dn_new(mem_ctx, ldb, FQDN_1779_name); canonical_name = ldb_dn_canonical_string(mem_ctx, FQDN_1779_dn); |