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

fix and enable load_nameservers_from_registry() fallback #1563

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfriedl
Copy link

@mfriedl mfriedl commented Feb 22, 2024

evdns_nameserver_ip_add_line() should return an error if an empty string is passed, so load_nameservers_from_registry() gets called if load_nameservers_with_getnetworkparams() cannot find any nameserver.

load_nameservers_from_registry() needs to:

  • iterate over interfaces
  • check for STATUS_SUCESS when fetching the size of the registry entry
  • use ascii variant of the lookup function since result is used as a string
  • null-terminate the retrieved registry value
  • release key handles on error

evdns_nameserver_ip_add_line() should return an error
if an empty string is passed, so load_nameservers_from_registry()
gets called if load_nameservers_with_getnetworkparams() cannot
find any nameserver.

load_nameservers_from_registry() needs to:

- iterate over interfaces
- check for STATUS_SUCESS when fetching the size of the registry entry
- use ascii variant of the lookup function since result is used as a string
- null-terminate the retrieved registry value
- release key handles on error
Copy link
Member

@azat azat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Is it possible to write a test?

@azat azat self-assigned this Mar 3, 2024
@mfriedl
Copy link
Author

mfriedl commented Mar 4, 2024 via email

@azat
Copy link
Member

azat commented Mar 5, 2024

It can be exposed via private header (evdns-internal.h), though I was talking about testing it as part of a regular NSes load, but I guess to test it you need to change windows registry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants