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 parsing of /etc/resolv.conf by manually updating resolv-conf crate #184

Merged
merged 2 commits into from
Sep 11, 2020

Conversation

Ma27
Copy link
Contributor

@Ma27 Ma27 commented Sep 11, 2020

Ma27 added a commit to NixOS/nixpkgs that referenced this pull request Sep 11, 2020
ChangeLogs:

* https://github.com/imsnif/bandwhich/releases/tag/0.18.1
* https://github.com/imsnif/bandwhich/releases/tag/0.18.0

Also applied a fix[1] for rDNS support which broke with `systemd-v246`
because the `resolv-conf` crate didn't support the `options
trust_ad`-declaration in systemd's `/etc/resolv.conf`[2].

[1] imsnif/bandwhich#184
[2] imsnif/bandwhich#166 (comment)
Ma27 added a commit to NixOS/nixpkgs that referenced this pull request Sep 11, 2020
ChangeLogs:

* https://github.com/imsnif/bandwhich/releases/tag/0.18.1
* https://github.com/imsnif/bandwhich/releases/tag/0.18.0

Also applied a fix[1] for rDNS support which broke with `systemd-v246`
because the `resolv-conf` crate didn't support the `options
trust_ad`-declaration in systemd's `/etc/resolv.conf`[2].

[1] imsnif/bandwhich#184
[2] imsnif/bandwhich#166 (comment)

(cherry picked from commit 8149ab1)
Copy link
Owner

@imsnif imsnif left a comment

Choose a reason for hiding this comment

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

Ah, interesting! Thanks for finding this and issuing the fix. I'll keep an eye on resolv-conf to see when they release a new version. I take it this solves the problem for you?

Also, could you run rustfmt so that the build passes?

src/os/shared.rs Outdated
@@ -238,7 +238,7 @@ pub fn get_input(
let mut runtime = Runtime::new()?;
let resolver = match runtime.block_on(dns::Resolver::new(runtime.handle().clone())) {
Ok(resolver) => resolver,
Err(_) => failure::bail!("Could not initialize the DNS resolver. Are you offline?"),
Err(err) => failure::bail!("Could not initialize the DNS resolver. Are you offline?\n\nReason: {:?}", err),
Copy link
Owner

Choose a reason for hiding this comment

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

❤️

This fixes the parsing of `/etc/resolv.conf` with `options trust-ad`
which is e.g. used in `systemd-resolved-v246`[1].

Refs imsnif#166

[1] systemd/systemd@a742f98
@Ma27
Copy link
Contributor Author

Ma27 commented Sep 11, 2020

Also, could you run rustfmt so that the build passes?

Done.

I take it this solves the problem for you?

Yes.

@imsnif imsnif merged commit 52f758d into imsnif:main Sep 11, 2020
@Ma27 Ma27 deleted the dns-init-fix branch September 11, 2020 15:29
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