s4-dns: cope with duplicate entries in dns_update_list
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 Aug 2011 05:47:27 +0000 (15:47 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 Aug 2011 21:39:39 +0000 (07:39 +1000)
this is needed for when DNSFOREST and DNSDOMAIN are the same

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

source4/scripting/bin/samba_dnsupdate

index 9609fe992bc0d9c3eabcedea80f2023a44f2e4e3..26c1124fbd37ca8825f93d440af0ffda14844576 100755 (executable)
@@ -390,6 +390,8 @@ sub_vars = get_subst_vars()
 update_list = []
 dns_list = []
 
+dup_set = set()
+
 # read each line, and check that the DNS name exists
 for line in file:
     line = line.strip()
@@ -400,7 +402,9 @@ for line in file:
         continue
     if d.type == 'AAAA' and len(IP6s) == 0:
         continue
-    dns_list.append(d)
+    if str(d) not in dup_set:
+        dns_list.append(d)
+        dup_set.add(str(d))
 
 # now expand the entries, if any are A record with ip set to $IP
 # then replace with multiple entries, one for each interface IP