summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2012-08-01 15:09:00 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-03 08:11:33 +0200
commitd6428319d4b13b0f37fac591fba83a62f356c7e5 (patch)
tree81befdfc686f83335ef3b4242377f38443ca0da3 /source4/scripting
parent8dde55c7fb55f3a03c222609d7340db8056c3365 (diff)
downloadsamba-d6428319d4b13b0f37fac591fba83a62f356c7e5.tar.gz
samba-d6428319d4b13b0f37fac591fba83a62f356c7e5.tar.bz2
samba-d6428319d4b13b0f37fac591fba83a62f356c7e5.zip
s4: samba_spnupdate: fix "if we are DNS server" check
We need to check if we have hasMasterNCs. If we are RODC we have hasFullReplicaNCs instead of hasMasterNCs. TODO: maybe check for hasFullReplicaNCs, too? Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/samba_spnupdate11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate
index 69406a8196..977de68bc2 100755
--- a/source4/scripting/bin/samba_spnupdate
+++ b/source4/scripting/bin/samba_spnupdate
@@ -130,11 +130,12 @@ res = samdb.search(base=samdb.get_config_basedn(),
basedn = str(samdb.get_default_basedn())
if len(res) == 1:
- for e in res[0]["msDS-hasMasterNCs"]:
- if str(e) == "DC=DomainDnsZones,%s" % basedn:
- has_domain_dns = True
- if str(e) == "DC=ForestDnsZones,%s" % basedn:
- has_forest_dns = True
+ if "msDS-hasMasterNCs" in res[0]:
+ for e in res[0]["msDS-hasMasterNCs"]:
+ if str(e) == "DC=DomainDnsZones,%s" % basedn:
+ has_domain_dns = True
+ if str(e) == "DC=ForestDnsZones,%s" % basedn:
+ has_forest_dns = True
# build the spn list