[PATCH] s4-dns: dlz-bind9: Continue lookup if error on multivalued record types

Samuel Cabrero scabrero at zentyal.com
Tue Jul 15 07:51:06 MDT 2014


Thanks Kai.

A wins/wins-r record looks like this (after extend dnsp.idl):

dnsRecord:     NDR: struct dnsp_DnssrvRpcRecord
         wDataLength              : 0x0018 (24)
         wType                    : DNS_TYPE_WINS (65281)
         version                  : 0x05 (5)
         rank                     : DNS_RANK_ZONE (240)
         flags                    : 0x0000 (0)
         dwSerial                 : 0x00000030 (48)
         dwTtlSeconds             : 0x00000000 (0)
         dwReserved               : 0x00000000 (0)
         dwTimeStamp              : 0x00000000 (0)
         data                     : union dnsRecordData(case 65281)
         wins: struct dnsp_wins
             dwMappingFlags           : 0x00000000 (0)
                    0: DNS_WINS_FLAG_SCOPE
                    0: DNS_WINS_FLAG_LOCAL
             dwLookupTimeout          : 0x00000002 (2)
             dwCacheTimeout           : 0x00283945 (2636101)
             cWinsServerCount         : 0x00000002 (2)
             aipWinsServers: ARRAY(2)
                 aipWinsServers           : 192.168.175.35
                 aipWinsServers           : 192.168.175.30

dnsRecord:     NDR: struct dnsp_DnssrvRpcRecord
         wDataLength              : 0x001a (26)
         wType                    : DNS_TYPE_WINSR (65282)
         version                  : 0x05 (5)
         rank                     : DNS_RANK_ZONE (240)
         flags                    : 0x0000 (0)
         dwSerial                 : 0x00000005 (5)
         dwTtlSeconds             : 0x00000000 (0)
         dwReserved               : 0x00000000 (0)
         dwTimeStamp              : 0x00000000 (0)
         data                     : union dnsRecordData(case 65282)
         winsr: struct dnsp_winsr
             dwMappingFlags           : 0x80010000 (2147549184)
                    1: DNS_WINS_FLAG_SCOPE
                    1: DNS_WINS_FLAG_LOCAL
             dwLookupTimeout          : 0x00000002 (2)
             dwCacheTimeout           : 0x00000384 (900)
             nameResultDomain         : foobar aaa



I have tried the internal DNS server and is not able to handle the record:
root at z35:/usr/local/samba# ./bin/samba-tool dns query 192.168.175.20 
kernevil.lan kernevil.lan ALL -Uxxx%xxx -d10
ndr_pull_error(2): Bad switch value 65281 at 
default/librpc/gen_ndr/ndr_dnsserver.c:690
Unable to ndr_pull structure for DnssrvEnumRecords2 - 
NT_STATUS_INVALID_PARAMETER
ERROR(runtime): uncaught exception - (-1073741811, 'Unexpected 
information received')
   File 
"/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/__init__.py", 
line 175, in _run
     return self.run(*args, **kwargs)
   File 
"/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/dns.py", line 
991, in run
     None, record_type, select_flags, None, None)

I am on it and will send a new patch set for internal DNS server.

Cheers.

On 15/07/14 03:53, Amitay Isaacs wrote:
> Hi Samuel,
>
> On Fri, Jul 11, 2014 at 2:07 AM, Samuel Cabrero <scabrero at zentyal.com
> <mailto:scabrero at zentyal.com>> wrote:
>
>     Hi Amitay,
>
>     I have extended the patch to catch it, together with a couple of
>     talloc contexts not freed.
>
>     Cheers.
>
>
> That's much better. Thanks.
>
>
>     On 10/07/14 11:11, Amitay Isaacs wrote:
>
>         On Thu, Jul 10, 2014 at 1:14 AM, Samuel Cabrero
>         <scabrero at zentyal.com <mailto:scabrero at zentyal.com>
>         <mailto:scabrero at zentyal.com <mailto:scabrero at zentyal.com>>> wrote:
>
>              Hi,
>
>              we have a report about bind dlz not being able to load a
>         zone which
>              have a WINS record type defined. Having a look to the code, the
>              lookup abort on multivalued record types as soon as it
>         finds a not
>              supported record type, so when the dlz is loading the zone
>         and query
>              the zone root (@), if the WINS record is returned by ldb search
>              before the SOA record bind complains with "zone
>         xxxxxx.xxx/NONE: has
>              0 SOA records" and does not start.
>
>              This patch makes the lookup operation to continue on errors, so
>              problematic records are logged and skipped.
>
>
>         The patch does not look complete.  If the zone only has WINS
>         type record
>         and no SOA record, then the code will return success when it falls
>         through the loop.
>
>         Amitay.
>
>
> As Kai mentioned before, it would be good to add a test with WINS record
> to make sure internal dns server and dns rpc server work correctly.
>
> Can you add a test or provide sample of a valid WINS record?
>
> Amitay.

-- 
Samuel Cabrero - Developer
scabrero at zentyal.com

Zentyal - Active Exchange
www.zentyal.com


More information about the samba-technical mailing list