diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-07-08 05:10:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:21 -0500 |
commit | 06a4e5688e05f1989a661815bd75e23d1f54e443 (patch) | |
tree | 16e9b1a95f4febc0f4c6470dcaa67b8609d975b7 | |
parent | a1a3b967315eee71da4d5d09d4fa9dd948502772 (diff) | |
download | samba-06a4e5688e05f1989a661815bd75e23d1f54e443.tar.gz samba-06a4e5688e05f1989a661815bd75e23d1f54e443.tar.bz2 samba-06a4e5688e05f1989a661815bd75e23d1f54e443.zip |
r8223: fix the values of nt_version and type we reply in the server code,
also name the struct like the nt_version number
metze
(This used to be commit 1e3af5cc1f68b7fa54b8ba77ed9836a619a69436)
-rw-r--r-- | source4/cldap_server/netlogon.c | 77 | ||||
-rw-r--r-- | source4/librpc/idl/nbt.idl | 36 | ||||
-rw-r--r-- | source4/torture/ldap/cldap.c | 12 |
3 files changed, 61 insertions, 64 deletions
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index f2530c46be..33f8734278 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -117,54 +117,51 @@ static NTSTATUS cldapd_netlogon_fill(struct cldapd_server *cldapd, break; case 2: case 3: - netlogon->logon2.pdc_name = pdc_name; - netlogon->logon2.user_name = user; - netlogon->logon2.domain_name = flatname; - netlogon->logon2.domain_uuid = domain_uuid; - netlogon->logon2.forest = realm; - netlogon->logon2.dns_domain = dns_domain; - netlogon->logon2.pdc_dns_name = pdc_dns_name; - netlogon->logon2.pdc_ip = pdc_ip; - netlogon->logon2.server_type = server_type; - netlogon->logon2.nt_version = 3; - netlogon->logon2.lmnt_token = 0xFFFF; - netlogon->logon2.lm20_token = 0xFFFF; - break; - case 4: - case 5: - case 6: - case 7: - netlogon->logon3.server_type = server_type; + netlogon->logon3.pdc_name = pdc_name; + netlogon->logon3.user_name = user; + netlogon->logon3.domain_name = flatname; netlogon->logon3.domain_uuid = domain_uuid; netlogon->logon3.forest = realm; netlogon->logon3.dns_domain = dns_domain; netlogon->logon3.pdc_dns_name = pdc_dns_name; - netlogon->logon3.domain = flatname; - netlogon->logon3.pdc_name = lp_netbios_name(); - netlogon->logon3.user_name = user; - netlogon->logon3.site_name = site_name; - netlogon->logon3.site_name2 = site_name2; - netlogon->logon3.nt_version = 3; + netlogon->logon3.pdc_ip = pdc_ip; + netlogon->logon3.server_type = server_type; netlogon->logon3.lmnt_token = 0xFFFF; netlogon->logon3.lm20_token = 0xFFFF; break; + case 4: + case 5: + case 6: + case 7: + netlogon->logon5.server_type = server_type; + netlogon->logon5.domain_uuid = domain_uuid; + netlogon->logon5.forest = realm; + netlogon->logon5.dns_domain = dns_domain; + netlogon->logon5.pdc_dns_name = pdc_dns_name; + netlogon->logon5.domain = flatname; + netlogon->logon5.pdc_name = lp_netbios_name(); + netlogon->logon5.user_name = user; + netlogon->logon5.site_name = site_name; + netlogon->logon5.site_name2 = site_name2; + netlogon->logon5.lmnt_token = 0xFFFF; + netlogon->logon5.lm20_token = 0xFFFF; + break; default: - netlogon->logon4.server_type = server_type; - netlogon->logon4.domain_uuid = domain_uuid; - netlogon->logon4.forest = realm; - netlogon->logon4.dns_domain = dns_domain; - netlogon->logon4.pdc_dns_name = pdc_dns_name; - netlogon->logon4.domain = flatname; - netlogon->logon4.pdc_name = lp_netbios_name(); - netlogon->logon4.user_name = user; - netlogon->logon4.site_name = site_name; - netlogon->logon4.site_name2 = site_name2; - netlogon->logon4.unknown = 10; - netlogon->logon4.unknown2 = 2; - netlogon->logon4.pdc_ip = pdc_ip; - netlogon->logon4.nt_version = 5; - netlogon->logon4.lmnt_token = 0xFFFF; - netlogon->logon4.lm20_token = 0xFFFF; + netlogon->logon13.server_type = server_type; + netlogon->logon13.domain_uuid = domain_uuid; + netlogon->logon13.forest = realm; + netlogon->logon13.dns_domain = dns_domain; + netlogon->logon13.pdc_dns_name = pdc_dns_name; + netlogon->logon13.domain = flatname; + netlogon->logon13.pdc_name = lp_netbios_name(); + netlogon->logon13.user_name = user; + netlogon->logon13.site_name = site_name; + netlogon->logon13.site_name2 = site_name2; + netlogon->logon13.unknown = 10; + netlogon->logon13.unknown2 = 2; + netlogon->logon13.pdc_ip = pdc_ip; + netlogon->logon13.lmnt_token = 0xFFFF; + netlogon->logon13.lm20_token = 0xFFFF; break; } diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl index f67509ec5e..db6dad9524 100644 --- a/source4/librpc/idl/nbt.idl +++ b/source4/librpc/idl/nbt.idl @@ -454,17 +454,17 @@ quite identical to, the netlogon structures above */ typedef struct { - [value(19)] uint16 type; + [value(21)] uint16 type; nstring pdc_name; nstring user_name; nstring domain_name; - uint32 nt_version; + [value(1)] uint32 nt_version; uint16 lmnt_token; uint16 lm20_token; } nbt_cldap_netlogon_1; typedef struct { - [value(19)] uint16 type; + [value(21)] uint16 type; nstring pdc_name; nstring user_name; nstring domain_name; @@ -475,13 +475,13 @@ nbt_string pdc_dns_name; ipv4address pdc_ip; nbt_server_type server_type; - uint32 nt_version; + [value(3)] uint32 nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_2; + } nbt_cldap_netlogon_3; typedef struct { - [value(23)] uint32 type; + [value(25)] uint32 type; nbt_server_type server_type; GUID domain_uuid; nbt_string forest; @@ -492,13 +492,13 @@ nbt_string user_name; nbt_string site_name; nbt_string site_name2; - uint32 nt_version; + [value(5)] uint32 nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_3; + } nbt_cldap_netlogon_5; typedef struct { - [value(23)] uint32 type; + [value(25)] uint32 type; nbt_server_type server_type; GUID domain_uuid; nbt_string forest; @@ -514,21 +514,21 @@ [flag(NDR_BIG_ENDIAN)] ipv4address pdc_ip; uint32 unknown3[2]; - uint32 nt_version; + [value(13)] uint32 nt_version; uint16 lmnt_token; uint16 lm20_token; - } nbt_cldap_netlogon_4; + } nbt_cldap_netlogon_13; typedef [flag(NDR_NOALIGN),public,nodiscriminant] union { [case(0)] nbt_cldap_netlogon_1 logon1; [case(1)] nbt_cldap_netlogon_1 logon1; - [case(2)] nbt_cldap_netlogon_2 logon2; - [case(3)] nbt_cldap_netlogon_2 logon2; - [case(4)] nbt_cldap_netlogon_3 logon3; - [case(5)] nbt_cldap_netlogon_3 logon3; - [case(6)] nbt_cldap_netlogon_3 logon3; - [case(7)] nbt_cldap_netlogon_3 logon3; - [default] nbt_cldap_netlogon_4 logon4; + [case(2)] nbt_cldap_netlogon_3 logon3; + [case(3)] nbt_cldap_netlogon_3 logon3; + [case(4)] nbt_cldap_netlogon_5 logon5; + [case(5)] nbt_cldap_netlogon_5 logon5; + [case(6)] nbt_cldap_netlogon_5 logon5; + [case(7)] nbt_cldap_netlogon_5 logon5; + [default] nbt_cldap_netlogon_13 logon13; } nbt_cldap_netlogon; /*******************************************/ diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c index 0a6af18b96..c0a073c2f8 100644 --- a/source4/torture/ldap/cldap.c +++ b/source4/torture/ldap/cldap.c @@ -63,7 +63,7 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) n1 = search.out.netlogon; search.in.user = "Administrator"; - search.in.realm = n1.logon4.dns_domain; + search.in.realm = n1.logon5.dns_domain; search.in.host = "__cldap_torture__"; printf("Scanning for netlogon levels\n"); @@ -104,7 +104,7 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) printf("Trying with a GUID\n"); search.in.realm = NULL; - search.in.domain_guid = GUID_string(mem_ctx, &n1.logon4.domain_uuid); + search.in.domain_guid = GUID_string(mem_ctx, &n1.logon5.domain_uuid); status = cldap_netlogon(cldap, mem_ctx, &search); CHECK_STATUS(status, NT_STATUS_OK); @@ -117,13 +117,13 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) printf("Trying with a AAC\n"); search.in.acct_control = 0x180; - search.in.realm = n1.logon4.dns_domain; + search.in.realm = n1.logon5.dns_domain; status = cldap_netlogon(cldap, mem_ctx, &search); CHECK_STATUS(status, NT_STATUS_OK); printf("Trying with a bad AAC\n"); search.in.acct_control = 0xFF00FF00; - search.in.realm = n1.logon4.dns_domain; + search.in.realm = n1.logon5.dns_domain; status = cldap_netlogon(cldap, mem_ctx, &search); CHECK_STATUS(status, NT_STATUS_OK); @@ -145,7 +145,7 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) CHECK_STATUS(status, NT_STATUS_NOT_FOUND); printf("Trying with a incorrect domain and correct guid\n"); - search.in.domain_guid = GUID_string(mem_ctx, &n1.logon4.domain_uuid); + search.in.domain_guid = GUID_string(mem_ctx, &n1.logon5.domain_uuid); status = cldap_netlogon(cldap, mem_ctx, &search); CHECK_STATUS(status, NT_STATUS_OK); @@ -156,7 +156,7 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest) printf("Trying with a incorrect GUID and correct domain\n"); search.in.domain_guid = GUID_string(mem_ctx, &guid); - search.in.realm = n1.logon4.dns_domain; + search.in.realm = n1.logon5.dns_domain; status = cldap_netlogon(cldap, mem_ctx, &search); CHECK_STATUS(status, NT_STATUS_OK); |