s4-join: make dsServiceName a GUID in @ROOTDSE on join
authorAndrew Tridgell <tridge@samba.org>
Thu, 11 Aug 2011 06:05:11 +0000 (16:05 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 12 Aug 2011 02:00:07 +0000 (04:00 +0200)
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 <abartlet@samba.org>

source4/scripting/python/samba/join.py

index 4495b527b938dcaf604df170f31b446d8b49ff35..c24e8d68009837335bc89dc282bcb03b757d66b6 100644 (file)
@@ -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("<GUID=%s>" % 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)