From ca8989daf36629ce47cf35d6e56f92d01f3172ec Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Thu, 14 Oct 2021 21:54:29 +0000 Subject: [PATCH] preloadNSS: warn if unable to open nss backend Signed-off-by: Arthur Gautier --- src/libmain/shared.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 1fb2d62d3..da3bc3bb5 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -125,7 +125,9 @@ static void preloadNSS() { load its lookup libraries in the parent before any child gets a chance to. */ std::call_once(dns_resolve_flag, []() { #ifdef __GLIBC__ - dlopen (LIBNSS_DNS_SO, RTLD_NOW); + if (dlopen (LIBNSS_DNS_SO, RTLD_NOW) == NULL) { + printMsg(Verbosity::lvlWarn, fmt("Unable to load nss_dns backend")); + } __nss_configure_lookup ("hosts", "dns"); #endif });