mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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 commit is contained in:
parent
0297943ff2
commit
1e3af5cc1f
@ -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;
|
||||
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.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->logon3.server_type = server_type;
|
||||
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.lmnt_token = 0xFFFF;
|
||||
netlogon->logon3.lm20_token = 0xFFFF;
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
/*******************************************/
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user