summaryrefslogtreecommitdiff
path: root/source4/dsdb/repl/drepl_partitions.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-08-22 17:30:15 +1000
committerAndrew Tridgell <tridge@samba.org>2011-08-25 07:39:38 +1000
commit5a9dc1d216fe419570891099fa7dd922bf025671 (patch)
tree5d37f7fbfe70d53b8acf409eacd4318e2a8a02ff /source4/dsdb/repl/drepl_partitions.c
parent484fb303ff2b7e5becd2ad9502ae8645657a3ced (diff)
downloadsamba-5a9dc1d216fe419570891099fa7dd922bf025671.tar.gz
samba-5a9dc1d216fe419570891099fa7dd922bf025671.tar.bz2
samba-5a9dc1d216fe419570891099fa7dd922bf025671.zip
s4-repl: fixed _msdcs DNS name
another multi-domain fix
Diffstat (limited to 'source4/dsdb/repl/drepl_partitions.c')
-rw-r--r--source4/dsdb/repl/drepl_partitions.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c
index 470a88f76d..e0f404511e 100644
--- a/source4/dsdb/repl/drepl_partitions.c
+++ b/source4/dsdb/repl/drepl_partitions.c
@@ -107,6 +107,7 @@ NTSTATUS dreplsrv_get_target_principal(struct dreplsrv_service *s,
int ret;
const char *hostname;
struct ldb_dn *dn;
+ struct ldb_dn *forest_dn;
*target_principal = NULL;
@@ -148,9 +149,15 @@ NTSTATUS dreplsrv_get_target_principal(struct dreplsrv_service *s,
* on it's record, it must also have GC/hostname/realm
* servicePrincipalName */
+ forest_dn = ldb_get_root_basedn(s->samdb);
+ if (forest_dn == NULL) {
+ talloc_free(tmp_ctx);
+ return NT_STATUS_OK;
+ }
+
*target_principal = talloc_asprintf(mem_ctx, "GC/%s/%s",
hostname,
- lpcfg_dnsdomain(s->task->lp_ctx));
+ samdb_dn_to_dns_domain(tmp_ctx, forest_dn));
talloc_free(tmp_ctx);
return NT_STATUS_OK;
}