From 2f2fc84a7c6724f6eab39bf301be70ba5bec15cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 May 2005 23:33:56 +0000 Subject: r6720: added support for the remaining 2 types of CLDAP netlogon response. To work around the fact that the type of the returned data is not encoded in the packet, this required adding ndr_pull_union_blob() which allows us to pull a blob into a union with a specified switch value, in this case the switch value comes from the calling NtVer field. (This used to be commit bd27e626c27be72913d1a1569ee6e2e2711df84e) --- source4/torture/ldap/cldap.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'source4/torture/ldap') diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c index 23bb7f5ba0..24cbc184ad 100644 --- a/source4/torture/ldap/cldap.c +++ b/source4/torture/ldap/cldap.c @@ -37,25 +37,19 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) struct cldap_netlogon search; int i; - search.in.dest_address = dest; - search.in.realm = lp_realm(); - search.in.host = lp_netbios_name(); - search.in.version = 6; - status = cldap_netlogon(cldap, mem_ctx, &search); + search.in.dest_address = dest; + search.in.realm = lp_realm(); + search.in.host = lp_netbios_name(); - if (!NT_STATUS_IS_OK(status)) { - printf("netlogon failed - %s\n", nt_errstr(status)); - } else { - NDR_PRINT_DEBUG(nbt_cldap_netlogon, &search.out.netlogon); - } - - for (i=0;i<20;i++) { + for (i=0;i<256;i++) { search.in.version = i; + printf("Trying netlogon level %d\n", i); status = cldap_netlogon(cldap, mem_ctx, &search); if (!NT_STATUS_IS_OK(status)) { printf("netlogon[%d] failed - %s\n", i, nt_errstr(status)); } else { - NDR_PRINT_DEBUG(nbt_cldap_netlogon, &search.out.netlogon); + NDR_PRINT_UNION_DEBUG(nbt_cldap_netlogon, i & 0xF, + &search.out.netlogon); } } -- cgit