|
Lines 71-76
NTSTATUS fill_netlogon_samlogon_response
Link Here
|
| 71 |
const char *server_site; |
71 |
const char *server_site; |
| 72 |
const char *client_site; |
72 |
const char *client_site; |
| 73 |
const char *pdc_ip; |
73 |
const char *pdc_ip; |
|
|
74 |
const char *application_fqdn = NULL; |
| 74 |
struct ldb_dn *domain_dn = NULL; |
75 |
struct ldb_dn *domain_dn = NULL; |
| 75 |
struct interface *ifaces; |
76 |
struct interface *ifaces; |
| 76 |
bool user_known = false, am_rodc = false; |
77 |
bool user_known = false, am_rodc = false; |
|
Lines 83-90
NTSTATUS fill_netlogon_samlogon_response
Link Here
|
| 83 |
} |
84 |
} |
| 84 |
|
85 |
|
| 85 |
/* Lookup using long or short domainname */ |
86 |
/* Lookup using long or short domainname */ |
| 86 |
if (domain && (strcasecmp_m(domain, lpcfg_dnsdomain(lp_ctx)) == 0)) { |
87 |
domain_dn = ldb_get_default_basedn(sam_ctx); |
| 87 |
domain_dn = ldb_get_default_basedn(sam_ctx); |
88 |
if (domain) { |
|
|
89 |
if (strcasecmp_m(domain, lpcfg_dnsdomain(lp_ctx)) == 0) { |
| 90 |
domain_dn = ldb_get_default_basedn(sam_ctx); |
| 91 |
} else { |
| 92 |
application_fqdn = talloc_asprintf(mem_ctx, "ForestDnsZones.%s", |
| 93 |
lpcfg_dnsdomain(lp_ctx)); |
| 94 |
if (domain && (strcasecmp_m(domain, application_fqdn) == 0)) { |
| 95 |
domain_dn = ldb_dn_copy(mem_ctx, ldb_get_default_basedn(sam_ctx)); |
| 96 |
NT_STATUS_HAVE_NO_MEMORY(domain_dn); |
| 97 |
if (!ldb_dn_add_child_fmt(domain_dn, "DC=ForestDnsZones")) { |
| 98 |
return NT_STATUS_NO_MEMORY; |
| 99 |
} |
| 100 |
} else { |
| 101 |
talloc_free(application_fqdn); |
| 102 |
application_fqdn = talloc_asprintf(mem_ctx, "DomainDnsZones.%s", |
| 103 |
lpcfg_dnsdomain(lp_ctx)); |
| 104 |
if (domain && (strcasecmp_m(domain, application_fqdn) == 0)) { |
| 105 |
domain_dn = ldb_dn_copy(mem_ctx, ldb_get_default_basedn(sam_ctx)); |
| 106 |
NT_STATUS_HAVE_NO_MEMORY(domain_dn); |
| 107 |
if (!ldb_dn_add_child_fmt(domain_dn, "DC=DomainDnsZones")) { |
| 108 |
return NT_STATUS_NO_MEMORY; |
| 109 |
} |
| 110 |
} else { |
| 111 |
talloc_free(application_fqdn); |
| 112 |
} |
| 113 |
} |
| 114 |
} |
| 88 |
} |
115 |
} |
| 89 |
if (netbios_domain && (strcasecmp_m(netbios_domain, lpcfg_sam_name(lp_ctx)) == 0)) { |
116 |
if (netbios_domain && (strcasecmp_m(netbios_domain, lpcfg_sam_name(lp_ctx)) == 0)) { |
| 90 |
domain_dn = ldb_get_default_basedn(sam_ctx); |
117 |
domain_dn = ldb_get_default_basedn(sam_ctx); |
|
Lines 274-279
NTSTATUS fill_netlogon_samlogon_response
Link Here
|
| 274 |
NT_STATUS_HAVE_NO_MEMORY(pdc_dns_name); |
301 |
NT_STATUS_HAVE_NO_MEMORY(pdc_dns_name); |
| 275 |
flatname = lpcfg_workgroup(lp_ctx); |
302 |
flatname = lpcfg_workgroup(lp_ctx); |
| 276 |
|
303 |
|
|
|
304 |
if (application_fqdn) { |
| 305 |
if (!(version & NETLOGON_NT_VERSION_PDC)) { |
| 306 |
dns_domain = application_fqdn; |
| 307 |
server_type = DS_SERVER_NDNC; |
| 308 |
server_type |= DS_SERVER_WRITABLE; |
| 309 |
server_type |= DS_SERVER_LDAP; |
| 310 |
} else { |
| 311 |
DEBUG(2,("DEBUG: netlogon application_fqdn NETLOGON_NT_VERSION_PDC\n")); |
| 312 |
} |
| 313 |
} |
| 314 |
|
| 277 |
server_site = samdb_server_site_name(sam_ctx, mem_ctx); |
315 |
server_site = samdb_server_site_name(sam_ctx, mem_ctx); |
| 278 |
NT_STATUS_HAVE_NO_MEMORY(server_site); |
316 |
NT_STATUS_HAVE_NO_MEMORY(server_site); |
| 279 |
client_site = samdb_client_site_name(sam_ctx, mem_ctx, |
317 |
client_site = samdb_client_site_name(sam_ctx, mem_ctx, |
|
Lines 309-315
NTSTATUS fill_netlogon_samlogon_response
Link Here
|
| 309 |
} |
347 |
} |
| 310 |
netlogon->data.nt5_ex.pdc_name = pdc_name; |
348 |
netlogon->data.nt5_ex.pdc_name = pdc_name; |
| 311 |
netlogon->data.nt5_ex.user_name = user; |
349 |
netlogon->data.nt5_ex.user_name = user; |
| 312 |
netlogon->data.nt5_ex.domain_name = flatname; |
350 |
if (!application_fqdn) { |
|
|
351 |
netlogon->data.nt5_ex.domain_name = flatname; |
| 352 |
} |
| 313 |
netlogon->data.nt5_ex.domain_uuid = domain_uuid; |
353 |
netlogon->data.nt5_ex.domain_uuid = domain_uuid; |
| 314 |
netlogon->data.nt5_ex.forest = forest_domain; |
354 |
netlogon->data.nt5_ex.forest = forest_domain; |
| 315 |
netlogon->data.nt5_ex.dns_domain = dns_domain; |
355 |
netlogon->data.nt5_ex.dns_domain = dns_domain; |
|
Lines 339-345
NTSTATUS fill_netlogon_samlogon_response
Link Here
|
| 339 |
} |
379 |
} |
| 340 |
netlogon->data.nt5.pdc_name = pdc_name; |
380 |
netlogon->data.nt5.pdc_name = pdc_name; |
| 341 |
netlogon->data.nt5.user_name = user; |
381 |
netlogon->data.nt5.user_name = user; |
| 342 |
netlogon->data.nt5.domain_name = flatname; |
382 |
if (!application_fqdn) { |
|
|
383 |
netlogon->data.nt5.domain_name = flatname; |
| 384 |
} |
| 343 |
netlogon->data.nt5.domain_uuid = domain_uuid; |
385 |
netlogon->data.nt5.domain_uuid = domain_uuid; |
| 344 |
netlogon->data.nt5.forest = forest_domain; |
386 |
netlogon->data.nt5.forest = forest_domain; |
| 345 |
netlogon->data.nt5.dns_domain = dns_domain; |
387 |
netlogon->data.nt5.dns_domain = dns_domain; |
|
Lines 360-366
NTSTATUS fill_netlogon_samlogon_response
Link Here
|
| 360 |
} |
402 |
} |
| 361 |
netlogon->data.nt4.pdc_name = pdc_name; |
403 |
netlogon->data.nt4.pdc_name = pdc_name; |
| 362 |
netlogon->data.nt4.user_name = user; |
404 |
netlogon->data.nt4.user_name = user; |
| 363 |
netlogon->data.nt4.domain_name = flatname; |
405 |
if (!application_fqdn) { |
|
|
406 |
netlogon->data.nt4.domain_name = flatname; |
| 407 |
} |
| 364 |
netlogon->data.nt4.nt_version = NETLOGON_NT_VERSION_1; |
408 |
netlogon->data.nt4.nt_version = NETLOGON_NT_VERSION_1; |
| 365 |
netlogon->data.nt4.lmnt_token = 0xFFFF; |
409 |
netlogon->data.nt4.lmnt_token = 0xFFFF; |
| 366 |
netlogon->data.nt4.lm20_token = 0xFFFF; |
410 |
netlogon->data.nt4.lm20_token = 0xFFFF; |