From: Björn Baumbach Date: Wed, 1 Aug 2012 13:09:00 +0000 (+0200) Subject: s4: samba_spnupdate: fix "if we are DNS server" check X-Git-Tag: ldb-1.1.10~148 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6428319d4b13b0f37fac591fba83a62f356c7e5;p=thirdparty%2Fsamba.git 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 --- diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate index 69406a8196b..977de68bc2c 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