From 52f758d608e8e6d9b27caf4d2e1295c413807108 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 11 Sep 2020 17:22:55 +0200 Subject: fix(dns): parsing of `/etc/resolv.conf` by manually updating `resolv-conf` crate (#184) * Show the error cause if initializing a DNS resolver fails * Manually bump `resolv-conf` to `master` at rev `83c0f25` This fixes the parsing of `/etc/resolv.conf` with `options trust-ad` which is e.g. used in `systemd-resolved-v246`[1]. Refs #166 [1] https://github.com/systemd/systemd/commit/a742f9828ea73d9c2c9bafe701c10fe60f058012 --- src/os/shared.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/os/shared.rs b/src/os/shared.rs index 4cc0c24..ea0f44d 100644 --- a/src/os/shared.rs +++ b/src/os/shared.rs @@ -238,7 +238,10 @@ 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 + ), }; let dns_client = dns::Client::new(resolver, runtime)?; Some(dns_client) -- cgit v1.2.3