From d6428319d4b13b0f37fac591fba83a62f356c7e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Baumbach?= Date: Wed, 1 Aug 2012 15:09:00 +0200 Subject: [PATCH] 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 --- source4/scripting/bin/samba_spnupdate | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 -- 2.34.1