From: Evan Hunt Date: Sat, 25 Oct 2025 07:20:58 +0000 (-0700) Subject: named -V doesn't need to parse default options X-Git-Tag: v9.21.15~22^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8921f472880833526d0c8afe8613a93ca650d2ff;p=thirdparty%2Fbind9.git named -V doesn't need to parse default options instead of parsing the default configuration to extract the geoip-directory value, we can just construct the value the same way it's done for the defaults. --- diff --git a/bin/named/main.c b/bin/named/main.c index 033ea994d61..d616910ca90 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -514,10 +514,6 @@ printversion(bool verbose) { char rndcconf[PATH_MAX], *dot = NULL; isc_buffer_t b; char buf[512]; -#if defined(HAVE_GEOIP2) - cfg_obj_t *config = NULL; - const cfg_obj_t *defaults = NULL, *obj = NULL; -#endif /* if defined(HAVE_GEOIP2) */ printf("%s (%s) \n", PACKAGE_STRING, PACKAGE_DESCRIPTION, PACKAGE_SRCID); @@ -610,16 +606,8 @@ printversion(bool verbose) { printf(" named PID file: %s\n", named_g_defaultpidfile); #if defined(HAVE_GEOIP2) #define RTC(x) RUNTIME_CHECK((x) == ISC_R_SUCCESS) - isc_mem_t *geoip_mctx = NULL; - isc_mem_create("geoip", &geoip_mctx); - RTC(named_config_parsedefaults(&config)); - RTC(cfg_map_get(config, "options", &defaults)); - RTC(cfg_map_get(defaults, "geoip-directory", &obj)); - if (cfg_obj_isstring(obj)) { - printf(" geoip-directory: %s\n", cfg_obj_asstring(obj)); - } - cfg_obj_detach(&config); - isc_mem_detach(&geoip_mctx); + printf(" geoip-directory: %s\n", + MAXMINDDB_PREFIX "/share/GeoIP\n"); #endif /* HAVE_GEOIP2 */ }