Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8970/8610223d backport][stable-8] dig lookup plugin: Fix using only last nameserver specified #8985

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Oct 5, 2024

This is a backport of PR #8970 as merged into main (8610223).

SUMMARY

Currently, when specifying multiple nameservers, only the very last one is actually used. Fix that by collecting all specified nameservers and passing them to the Resolver after the argument processing is done.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

dig

ADDITIONAL INFORMATION

Currently, when specifying multiple nameservers either using multiple @ns.example.com arguments or by specifying multiple nameservers in a single argument (@ns1.example.com,ns2.example.com), due to a bug only the very last nameserver that is specified is actually used.
This is because for every iteration of the for ns in nsset loop, the local list of nameservers is cleared and after adding the currently processed nameserver entry, the whole nameservers list of the Resolver instance is overridden with that new list with just one element. And as far as I can see, when setting that nameserver property, the dnspython library actually overrides the existing list and doesn't do some trickery to append the new nameservers or something like that.

Therefore, the assignment of the nameservers property of the Resolver is moved after the argument processing so all nameservers are added and then collectively written to the nameservers property of the Resolver.

* dig plugin: Fix using only last nameserver given

Currently, when specifying multiple nameservers
either using multiple `@ns.example.com` arguments
or by specifying multiple nameservers in a single
argument (@ns1.example.com,ns2.example.com), due
to a bug only the very last nameserver that is
specified is actually used.
This is because for every iteration of the
    for ns in nsset
loop, the local list of nameservers is cleared
and after adding the currently processed nameserver
entry, the whole `nameservers` list of the Resolver
instance is overridden with that new list with just
one element. And as far as I can see, when setting
that `nameserver` property, the dnspython library
actually overrides the existing list and doesn't
do some trickery to append the new nameservers or
something like that.

Therefore, the assignment of the `nameservers`
property of the Resolver is moved after the argument
processing so all nameservers are added and then
collectively written to the `nameservers` property
of the Resolver.

* Add CHANGELOG fragment

(cherry picked from commit 8610223)
@felixfontein felixfontein merged commit d9d9148 into stable-8 Oct 5, 2024
128 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-8/8610223d03d46c02b4190661a62d1977ba8f4a89/pr-8970 branch October 5, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants