--- /usr/share/pyshared/univention/s4connector/s4/dns.py.orig 2018-02-28 23:20:06.988000000 +0100 +++ /usr/share/pyshared/univention/s4connector/s4/dns.py.orig 2018-03-01 00:29:22.904000000 +0100 @@ -1584,21 +1584,30 @@ dc = object['attributes'].get('dc') if oc and 'dnsZone' in oc: # forward or reverse zone - if dc and dc[0].endswith('in-addr.arpa'): - return 'reverse_zone' - else: - return 'forward_zone' + if dc: + if dc[0].endswith('.in-addr.arpa'): + return 'reverse_zone' + elif 'deleted_dn' in object and dc[0].find('.in-addr.arpa\nDEL:') != -1: + return 'reverse_zone' + else: + return 'forward_zone' if oc and 'dnsNode' in oc: - if dc and dc[0] == '@': + if dc: + if 'deleted_dn' in object: + ud.debug(ud.LDAP, ud.INFO, '_identify_dns_con_object: deleted_dn in object') + if 'deleted_dn' in object and dc[0].startswith('@\nDEL:') != -1: + ud.debug(ud.LDAP, ud.INFO, '_identify_dns_con_object: .startswith DEL') + if dc and (dc[0] == '@' or ('deleted_dn' in object and dc[0].startswith('@\nDEL:') != -1)): zone_type = 'forward_zone' exploded_dn = ldap.dn.str2dn(unicode_to_utf8(object['dn'])) for multi_rdn in exploded_dn: + ud.debug(ud.LDAP, ud.INFO, 'multi_rdn: %s' % (multi_rdn[0],)) (attribute, value, _flags) = multi_rdn[0] + ud.debug(ud.LDAP, ud.INFO, 'attribute: %s, value: %s' % (attribute, value)) if attribute.lower() == 'zonename' and value.lower().endswith('in-addr.arpa'): zone_type = 'reverse_zone' break return zone_type - else: dnsRecords = object['attributes'].get('dnsRecord') if not dnsRecords: