diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-09-27 14:34:43 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-09-27 23:18:23 +0000 |
commit | 8edf3d71318acdba73f7415ae2db7b7988e34029 (patch) | |
tree | 29391973690abc69a463f97af1d22a572eabdbcf /source4 | |
parent | 43d0c2e9ea71770aa87e74778c20908606cd55f8 (diff) | |
download | samba-8edf3d71318acdba73f7415ae2db7b7988e34029.tar.gz samba-8edf3d71318acdba73f7415ae2db7b7988e34029.tar.bz2 samba-8edf3d71318acdba73f7415ae2db7b7988e34029.zip |
s4-dns: avoid search domains expansion in DNS resolver
add a '.' if the name contains a '.' already, but not at the end
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libcli/resolve/dns_ex.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c index 76dd103154..711eb0abf1 100644 --- a/source4/libcli/resolve/dns_ex.c +++ b/source4/libcli/resolve/dns_ex.c @@ -92,6 +92,14 @@ static void run_child_dns_lookup(struct dns_ex_state *state, int fd) uint32_t i; bool do_srv = (state->flags & RESOLVE_NAME_FLAG_DNS_SRV); + if (strchr(state->name.name, '.') && state->name.name[strlen(state->name.name)-1] != '.') { + /* we are asking for a fully qualified name, but the + name doesn't end in a '.'. We need to prevent the + DNS library trying the search domains configured in + resolv.conf */ + state->name.name = talloc_strdup_append(state->name.name, "."); + } + /* this is the blocking call we are going to lots of trouble to avoid in the parent */ reply = rk_dns_lookup(state->name.name, do_srv?"SRV":"A"); |