getaddrinfo()-related replication problem on FreeBSD

Andrew Bartlett abartlet at samba.org
Mon Jun 4 16:44:11 MDT 2012


On Tue, 2012-06-05 at 01:29 +0300, Andriy Syrovenko wrote:
> Hi,
> 
> I've been playing with replication, and discovered that getaddrinfo()
> on FreeBSD does not like underscores in names if the name in question
> comes from the DNS. This in turn causes the replication to always
> fail, since DNS queries for the <GUID>._msdcs.domain.name fail.
> 
> The following (dumb and straightforward) patch solves the problem,
> though I'm quite sure this is not the right way to go.
> 
> diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
> index 7f5b841..1f6dfad 100644
> --- a/source4/libcli/resolve/dns_ex.c
> +++ b/source4/libcli/resolve/dns_ex.c
> @@ -616,11 +616,11 @@ struct composite_context
> *resolve_name_dns_ex_send(TALLOC_CTX *mem_ctx,
> 
>         if (state->child == 0) {
>                 close(fd[0]);
> -               if (state->flags & RESOLVE_NAME_FLAG_FORCE_DNS) {
> +//             if (state->flags & RESOLVE_NAME_FLAG_FORCE_DNS) {
>                         run_child_dns_lookup(state, fd[1]);
> -               } else {
> -                       run_child_getaddrinfo(state, fd[1]);
> -               }
> +//             } else {
> +//                     run_child_getaddrinfo(state, fd[1]);
> +//             }
>                 _exit(0);
>         }
>         close(fd[1]);
> 
> Could someone please point me in the right direction, so I could
> prepare a better patch.

Andrey,

This isn't as silly as it looks, in that there will be other cases where
we need to force DNS as well - any time we run in make test for example,
we will want to force DNS at some level and use our internal DNS library
to query our internal DNS server (once this is set up in make test).

A patch to the wscript to detect platforms with this breakage (I'm
surprised it hasn't been noticed elsewhere before!) and then a patch to
force the flag on seems most sensible at this point.  

Andrew Bartlett


-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org



More information about the samba-technical mailing list