From bb6214d63440d52227ea94d1788b6875b4d4742c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Aug 2011 16:05:11 +1000 Subject: s4-join: make dsServiceName a GUID in @ROOTDSE on join when joining another domain as a DC we should setup our dsServiceName in @ROOTDSE to be a GUID so we can cope with later server renames Pair-Programmed-With: Andrew Bartlett --- source4/scripting/python/samba/join.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index 4495b527b9..c24e8d6800 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -500,11 +500,13 @@ class dc_join(object): def join_finalise(ctx): '''finalise the join, mark us synchronised and setup secrets db''' - print "Setting isSynchronized" + print "Setting isSynchronized and dsServiceName" m = ldb.Message() - m.dn = ldb.Dn(ctx.samdb, '@ROOTDSE') + m.dn = ldb.Dn(ctx.local_samdb, '@ROOTDSE') m["isSynchronized"] = ldb.MessageElement("TRUE", ldb.FLAG_MOD_REPLACE, "isSynchronized") - ctx.samdb.modify(m) + m["dsServiceName"] = ldb.MessageElement("" % str(ctx.ntds_guid), + ldb.FLAG_MOD_REPLACE, "dsServiceName") + ctx.local_samdb.modify(m) secrets_ldb = Ldb(ctx.paths.secrets, session_info=system_session(), lp=ctx.lp) -- cgit