samba-tool domain join subdomain: Set "reveal_internals:0" control so we can see...
authorAndrew Bartlett <abartlet@samba.org>
Mon, 16 Sep 2013 17:23:07 +0000 (10:23 -0700)
committerStefan Metzmacher <metze@samba.org>
Mon, 16 Sep 2013 17:36:18 +0000 (19:36 +0200)
The issue here is that we create the ncName remotely with DsAddEntry,
and then replicate it back.  However, at this point the naming context
pointed at by the ncName does not exist!  The issue is that the
extended_dn_out module then hides the link, because it points to a
missing object.  The reveal_internals control forces this link to be
returned, and so we can then find the GUID, to create the domain with
the right GUID.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
python/samba/join.py

index 7c14c2adb9016f36d93a73aa5d5954936cb06ba2..ff0fe3bdfb8302bea632d7d5abf5b82c9cb43e58 100644 (file)
@@ -747,7 +747,7 @@ class dc_join(object):
 
         print("Finding domain GUID from ncName")
         res = ctx.local_samdb.search(base=ctx.partition_dn, scope=ldb.SCOPE_BASE, attrs=['ncName'],
-                                     controls=["extended_dn:1:1"])
+                                     controls=["extended_dn:1:1", "reveal_internals:0"])
         domguid = str(misc.GUID(ldb.Dn(ctx.samdb, res[0]['ncName'][0]).get_extended_component('GUID')))
         print("Got domain GUID %s" % domguid)