samba4 and libdlz_bind9.so

Matthieu Patou mat at samba.org
Fri Jul 8 08:34:17 MDT 2011


Hi Gemes,

First thanks for spending sometime in this patch, the rest of my email 
might sound like the only word I know is "no", which of course is not true.
Don't give up !
> Hi,
>
> What about a patch like the attached?
Well not !
>
> --- a/source4/scripting/python/samba/provision/__init__.py	2011-07-07 08:10:40.000171756 +0200
> +++ b/source4/scripting/python/samba/provision/__init__.py	2011-07-08 13:12:52.764589429 +0200
> @@ -1763,7 +1763,7 @@
>                       dnsdomain=names.dnsdomain,
>                       dns_keytab_path=paths.dns_keytab, dnspass=dnspass)
>
> -                setup_ad_dns(samdb, names=names, hostip=hostip, hostip6=hostip6)
> +                setup_ad_dns(samdb, names=names, hostip=hostip, hostip6=hostip6, dom_for_fun_level=dom_for_fun_level)
>   

Can we use a shorter name, like forest_level ?


> --- a/source4/scripting/python/samba/provision/sambadns.py	2011-07-07 08:10:40.008170916 +0200
> +++ b/source4/scripting/python/samba/provision//sambadns.py	2011-07-08 13:08:13.675811563 +0200
> @@ -79,7 +79,16 @@
>           srv.wWeight = weight
>           self.data = srv
>
> -def setup_ad_dns(samdb, names, hostip=None, hostip6=None):
> +def setup_ad_dns(samdb, names, hostip=None, hostip6=None, dom_for_fun_level=None):
> +
> +    if dom_for_fun_level is None:
> +        dom_for_fun_level = DS_DOMAIN_FUNCTION_2003
> +
> +	if dom_for_fun_level == DS_DOMAIN_FUNCTION_2003:
> +		dns_ldap_root = "CN=MicrosoftDNS,CN=System,%s"
> +	elif dom_for_fun_level == DS_DOMAIN_FUNCTION_2008 || dom_for_fun_level == DS_DOMAIN_FUNCTION_2008_R2:
> +		dns_ldap_root = "CN=MicrosoftDNS,DC=DomainDnsZones"
What about the forest level 2000 ? Is it the forest level or the domain level that has an influence on container location ?
> +
>       domaindn = names.domaindn
>       dnsdomain = names.dnsdomain.lower()
>       hostname = names.netbiosname.lower()
> @@ -113,7 +122,7 @@
>           at_aaaa_record = AAAARecord(hostip6)
>           dns_records.append(ndr_pack(at_aaaa_record))
>
> -    msg = ldb.Message(ldb.Dn(samdb, "DC=@,DC=%s,CN=MicrosoftDNS,CN=System,%s" %\
> +    msg = ldb.Message(ldb.Dn(samdb, "DC=@,DC=%s,"+dns_ldap_root %\
>                                       (dnsdomain, domaindn )))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = ldb.MessageElement(soa_subrecords + dns_records,

Avoid the "foo" + "bar" notation, prefer the % one, ie
dnscontainer = "%s, %s" % ("CN=MicrosoftDNS,CN=System", "domaindn")
"DC=@, DC=%s, %" % (dnsdomain, dnscontainerdn)

>   @@ -123,7 +132,7 @@
>       # _gc._tcp record
>       gc_tcp_record = SRVRecord(dnsname, 3268)
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_gc._tcp,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_gc._tcp,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(gc_tcp_record)]
> @@ -131,7 +140,7 @@
>
>       # _gc._tcp.sitename._site record
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_gc._tcp.%s._sites,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_gc._tcp.%s._sites,DC=%s,"+dns_ldap_root % \
>                       (names.sitename, dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(gc_tcp_record)]
> @@ -140,7 +149,7 @@
>       # _kerberos._tcp record
>       kerberos_record = SRVRecord(dnsname, 88)
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_kerberos._tcp,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_kerberos._tcp,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(kerberos_record)]
> @@ -148,7 +157,7 @@
>
>       # _kerberos._tcp.sitename._site record
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_kerberos._tcp.%s._sites,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_kerberos._tcp.%s._sites,DC=%s,"+dns_ldap_root % \
>                       (site, dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(kerberos_record)]
> @@ -156,7 +165,7 @@
>
>       # _kerberos._udp record
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_kerberos._udp,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_kerberos._udp,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(kerberos_record)]
> @@ -165,7 +174,7 @@
>       # _kpasswd._tcp record
>       kpasswd_record = SRVRecord(dnsname, 464)
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_kpasswd._tcp,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_kpasswd._tcp,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(kpasswd_record)]
> @@ -173,7 +182,7 @@
>
>       # _kpasswd._udp record
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_kpasswd._udp,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_kpasswd._udp,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(kpasswd_record)]
> @@ -182,7 +191,7 @@
>       # _ldap._tcp record
>       ldap_record = SRVRecord(dnsname, 389)
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_ldap._tcp,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_ldap._tcp,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(ldap_record)]
> @@ -190,7 +199,7 @@
>
>       # _ldap._tcp.sitename._site record
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_ldap._tcp.%s._site,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_ldap._tcp.%s._site,DC=%s,"+dns_ldap_root % \
>                       (site, dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(ldap_record)]
> @@ -199,7 +208,7 @@
>       # _msdcs record
>       msdcs_record = NSRecord(dnsname)
>       msg = ldb.Message(ldb.Dn(samdb,
> -            "DC=_msdcs,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +            "DC=_msdcs,DC=%s,"+dns_ldap_root % \
>                       (dnsdomain, domaindn)))
>       msg["objectClass"] = ["top", "dnsNode"]
>       msg["dnsRecord"] = [ndr_pack(msdcs_record)]
> @@ -211,7 +220,7 @@
>       # doesn't set up any IPs
>       if len(dns_records)>  0:
>           msg = ldb.Message(ldb.Dn(samdb,
> -                "DC=%s,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +                "DC=%s,DC=%s,"+dns_ldap_root % \
>                           (hostname, dnsdomain, domaindn)))
>           msg["objectClass"] = ["top", "dnsNode"]
>           msg["dnsRecord"] = ldb.MessageElement(dns_records,
> @@ -220,7 +229,7 @@
>
>           # DomainDnsZones record
>           msg = ldb.Message(ldb.Dn(samdb,
> -                "DC=DomainDnsZones,DC=%s,CN=MicrosoftDNS,CN=System,%s" % \
> +                "DC=DomainDnsZones,DC=%s,"+dns_ldap_root % \
>                           (dnsdomain, domaindn)))
>           msg["objectClass"] = ["top", "dnsNode"]
>           msg["dnsRecord"] = ldb.MessageElement(dns_records,
Same remarks



I would prefer more than patch, one than make the DN for DNS object container defined in a variable and that replace all the place then a second one that introduce multiple name for the DN depending on the forest or domain level.

But for this to work we have to add also naming context.


-- 
Matthieu Patou
Samba Team        http://samba.org
Private repo      http://git.samba.org/?p=mat/samba.git;a=summary




More information about the samba-technical mailing list