samba_dnsupdate: Look for ForestDnsZones in the right place
authorAndrew Bartlett <abartlet@samba.org>
Thu, 25 Sep 2014 22:42:16 +0000 (15:42 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 27 Sep 2014 20:09:29 +0000 (22:09 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Sep 27 22:09:29 CEST 2014 on sn-devel-104

source4/scripting/bin/samba_dnsupdate

index 30d5608d50aa8829051d5590443234ceb79f2f1b..181e67fdf2fddd6d087edd83bdc9dfc9f656c05c 100755 (executable)
@@ -299,6 +299,8 @@ def get_subst_vars(samdb):
                     vars['IF_RWGC'] = ""
 
         basedn = str(samdb.get_default_basedn())
+        forestdn = str(samdb.get_root_basedn())
+
         if "msDS-hasMasterNCs" in res[0]:
             for e in res[0]["msDS-hasMasterNCs"]:
                 if str(e) == "DC=DomainDnsZones,%s" % basedn:
@@ -307,7 +309,7 @@ def get_subst_vars(samdb):
                         vars['IF_RODNS_DOMAIN'] = ""
                     else:
                         vars['IF_RWDNS_DOMAIN'] = ""
-                if str(e) == "DC=ForestDnsZones,%s" % basedn:
+                if str(e) == "DC=ForestDnsZones,%s" % forestdn:
                     vars['IF_DNS_FOREST'] = ""
                     if am_rodc:
                         vars['IF_RODNS_FOREST'] = ""