From 0b8b29f070ea27ce3b9a7fe88bbe85927f7bd868 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 13 May 2005 11:56:36 +0000 Subject: r6776: make the cldap torture test not dependent on the realm being set correctly - it gets the realm from an initial no-attribute search (This used to be commit 52d10c8d99521f9dd02891a30688472d96860aef) --- source4/torture/ldap/cldap.c | 81 +++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 27 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c index b22dc7b47c..2978419a2a 100644 --- a/source4/torture/ldap/cldap.c +++ b/source4/torture/ldap/cldap.c @@ -42,19 +42,28 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) { struct cldap_socket *cldap = cldap_socket_init(mem_ctx, NULL); NTSTATUS status; - struct cldap_netlogon search; + struct cldap_netlogon search, empty_search; union nbt_cldap_netlogon n1; struct GUID guid; int i; BOOL ret = True; + ZERO_STRUCT(search); search.in.dest_address = dest; - search.in.realm = lp_realm(); - search.in.host = lp_netbios_name(); - search.in.user = NULL; - search.in.domain_guid = NULL; - search.in.domain_sid = NULL; search.in.acct_control = -1; + search.in.version = 6; + + empty_search = search; + + printf("Trying without any attributes\n"); + search = empty_search; + status = cldap_netlogon(cldap, mem_ctx, &search); + CHECK_STATUS(status, NT_STATUS_OK); + + n1 = search.out.netlogon; + + search.in.realm = n1.logon4.dns_domain; + search.in.host = "__cldap_torture__"; printf("Scanning for netlogon levels\n"); for (i=0;i<256;i++) { @@ -68,10 +77,21 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) } } + printf("Scanning for netlogon level bits\n"); + for (i=0;i<31;i++) { + search.in.version = (1<