LDAP-CLDAP: demonstrate that pdc name is not an unc path
authorStefan Metzmacher <metze@samba.org>
Wed, 4 Jan 2012 10:46:47 +0000 (11:46 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 4 Jan 2012 19:06:14 +0000 (20:06 +0100)
For LOGON_SAM_LOGON_RESPONSE_EX and LOGON_SAM_LOGON_USER_UNKNOWN_EX,
pdc name is not in unc path form.

[MS-ADTS] 7.3.1.* uses UnicodeLogonServer, which seems to be in unc form,
while NetbiosComputerName is not in unc form.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jan  4 20:06:14 CET 2012 on sn-devel-104

source4/torture/ldap/cldap.c

index b3f62762cfb8a7dbd40768f9093fa81a611ffc85..fc8c337ff3c96877239713fbb34a3da61761cf5c 100644 (file)
@@ -105,6 +105,9 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
        CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
+       torture_assert(tctx,
+                      strstr(search.out.netlogon.data.nt5_ex.pdc_name, "\\\\") == NULL,
+                      "PDC name should not be in UNC form");
 
        printf("Trying with User=Administrator\n");
        search.in.user = "Administrator";
@@ -112,6 +115,9 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
        CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
+       torture_assert(tctx,
+                      strstr(search.out.netlogon.data.nt5_ex.pdc_name, "\\\\") == NULL,
+                      "PDC name should not be in UNC form");
 
        search.in.version = NETLOGON_NT_VERSION_5;
        status = cldap_netlogon(cldap, tctx, &search);
@@ -146,6 +152,9 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
        CHECK_STATUS(status, NT_STATUS_OK);
        CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
        CHECK_STRING(GUID_string(tctx, &search.out.netlogon.data.nt5_ex.domain_uuid), search.in.domain_guid);
+       torture_assert(tctx,
+                      strstr(search.out.netlogon.data.nt5_ex.pdc_name, "\\\\") == NULL,
+                      "PDC name should not be in UNC form");
 
        printf("Trying with a incorrect GUID\n");
        guid = GUID_random();