getaddrinfo()-related replication problem on FreeBSD

Andriy Syrovenko andriys at gmail.com
Mon Jun 4 16:29:09 MDT 2012


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.

Regards,
Andrey.


More information about the samba-technical mailing list