View | Details | Raw Unified | Return to bug 37687 | Differences between
and this patch

Collapse All | Expand All

(-)samba-4.2.0~rc2/source4/setup/dns_update_list.orig (+2 lines)
 Lines 37-42    Link Here 
37
${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP
39
${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP
38
${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP
40
${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP
39
${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389
41
${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389
42
${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.pdc._msdcs.DomainDnsZones.${DNSDOMAIN}     ${HOSTNAME} 389
43
${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.pdc._msdcs.ForestDnsZones.${DNSDOMAIN}     ${HOSTNAME} 389
40
# RW and RO DNS servers
44
# RW and RO DNS servers
41
${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389
45
${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389
42
46
(-)samba-4.2.0~rc2/source4/dsdb/samdb/ldb_modules/partition.c.orig (-1 / +29 lines)
 Lines 528-533   static int partition_replicate(struct ld Link Here 
528
	return partition_call_first(ac);
528
	return partition_call_first(ac);
529
}
529
}
530
530
531
struct Dict {
532
        char *key;
533
        char *val;
534
};
535
531
/* search */
536
/* search */
532
static int partition_search(struct ldb_module *module, struct ldb_request *req)
537
static int partition_search(struct ldb_module *module, struct ldb_request *req)
533
{
538
{
 Lines 548-553   static int partition_search(struct ldb_m Link Here 
548
	unsigned int i, j;
553
	unsigned int i, j;
549
	int ret;
554
	int ret;
550
	bool domain_scope = false, phantom_root = false;
555
	bool domain_scope = false, phantom_root = false;
556
	struct ldb_result *res;
557
        char * partition_host_domainname;
551
558
552
	p = find_partition(data, NULL, req);
559
	p = find_partition(data, NULL, req);
553
	if (p != NULL) {
560
	if (p != NULL) {
 Lines 605-610   static int partition_search(struct ldb_m Link Here 
605
	lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
612
	lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
606
						struct loadparm_context);
613
						struct loadparm_context);
607
614
615
	char *forestdnszones_dn = talloc_asprintf(ac, "DC=ForestDnsZones,%s", ldb_dn_get_linearized(ldb_get_default_basedn(ldb)));
616
	char *forestdnszones_fqdn = talloc_asprintf(ac, "ForestDnsZones.%s", lpcfg_dnsdomain(lp_ctx));
617
	char *domaindnszones_dn = talloc_asprintf(ac, "DC=DomainDnsZones,%s", ldb_dn_get_linearized(ldb_get_default_basedn(ldb)));
618
	char *domaindnszones_fqdn = talloc_asprintf(ac, "DomainDnsZones.%s", lpcfg_dnsdomain(lp_ctx));
619
        struct Dict dn_to_fqdn_map[] = {
620
		{ forestdnszones_dn, forestdnszones_fqdn },
621
		{ domaindnszones_dn, domaindnszones_fqdn },
622
		NULL
623
	};
624
608
	/* Search from the base DN */
625
	/* Search from the base DN */
609
	if (ldb_dn_is_null(req->op.search.base)) {
626
	if (ldb_dn_is_null(req->op.search.base)) {
610
		if (!phantom_root) {
627
		if (!phantom_root) {
 Lines 681-692   static int partition_search(struct ldb_m Link Here 
681
						 data->partitions[i]->ctrl->dn) == 0) &&
698
						 data->partitions[i]->ctrl->dn) == 0) &&
682
			    (ldb_dn_compare(req->op.search.base,
699
			    (ldb_dn_compare(req->op.search.base,
683
					    data->partitions[i]->ctrl->dn) != 0)) {
700
					    data->partitions[i]->ctrl->dn) != 0)) {
701
702
				partition_host_domainname = lpcfg_dnsdomain(lp_ctx);
703
				for (j=0; j<2; j++) {
704
					if (strcasecmp_m(ldb_dn_get_linearized(data->partitions[i]->ctrl->dn), dn_to_fqdn_map[j].key) == 0) {
705
						partition_host_domainname = dn_to_fqdn_map[j].val;
706
						break;
707
					}
708
				}
709
684
				char *ref = talloc_asprintf(ac,
710
				char *ref = talloc_asprintf(ac,
685
							    "ldap://%s/%s%s",
711
							    "ldap://%s/%s%s",
686
							    lpcfg_dnsdomain(lp_ctx),
712
							    partition_host_domainname,
713
							    // lpcfg_dnsdomain(lp_ctx),
687
							    ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
714
							    ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
688
							    req->op.search.scope == LDB_SCOPE_ONELEVEL ? "??base" : "");
715
							    req->op.search.scope == LDB_SCOPE_ONELEVEL ? "??base" : "");
689
716
717
690
				if (ref == NULL) {
718
				if (ref == NULL) {
691
					return ldb_oom(ldb);
719
					return ldb_oom(ldb);
692
				}
720
				}
(-)samba-4.2.0~rc2/source4/dsdb/samdb/ldb_modules/netlogon.c.orig (-5 / +49 lines)
 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;

Return to bug 37687