Commit 5d4182c9 authored by Mark Andrews's avatar Mark Andrews

Merge branch '1301-geoip2-default-data-path' into 'master'

Resolve "geoip2 default data path"

Closes #1301

See merge request !2520
parents ae33c75d 7b10faf1
Pipeline #24913 passed with stages
in 1 minute and 57 seconds
5313. [bug] The default GeoIP2 database location did not match
the ARM. 'named -V' now reports the default
location. [GL #1301]
5312. [bug] Do not flush the cache for `rndc validation status`. 5312. [bug] Do not flush the cache for `rndc validation status`.
Thanks to Tony Finch. [GL !2462] Thanks to Tony Finch. [GL !2462]
......
...@@ -65,7 +65,7 @@ options {\n\ ...@@ -65,7 +65,7 @@ options {\n\
" files unlimited;\n" " files unlimited;\n"
#endif #endif
#if defined(HAVE_GEOIP2) && !defined(WIN32) #if defined(HAVE_GEOIP2) && !defined(WIN32)
" geoip-directory \"" MAXMINDDB_PREFIX "/share/GeoIP2\";\n" " geoip-directory \"" MAXMINDDB_PREFIX "/share/GeoIP\";\n"
#elif defined(HAVE_GEOIP2) #elif defined(HAVE_GEOIP2)
" geoip-directory \".\";\n" " geoip-directory \".\";\n"
#endif #endif
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include <ns/interfacemgr.h> #include <ns/interfacemgr.h>
#include <named/builtin.h> #include <named/builtin.h>
#include <named/config.h>
#include <named/control.h> #include <named/control.h>
#include <named/fuzz.h> #include <named/fuzz.h>
#include <named/globals.h> /* Explicit, though named/log.h includes it. */ #include <named/globals.h> /* Explicit, though named/log.h includes it. */
...@@ -483,6 +484,12 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) { ...@@ -483,6 +484,12 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
static void static void
printversion(bool verbose) { printversion(bool verbose) {
char rndcconf[PATH_MAX], *dot = NULL; char rndcconf[PATH_MAX], *dot = NULL;
#if defined(HAVE_GEOIP2)
isc_mem_t *mctx = NULL;
cfg_parser_t *parser = NULL;
cfg_obj_t *config = NULL;
const cfg_obj_t *defaults = NULL, *obj = NULL;
#endif
printf("%s %s%s%s <id:%s>\n", printf("%s %s%s%s <id:%s>\n",
named_g_product, named_g_version, named_g_product, named_g_version,
...@@ -569,7 +576,20 @@ OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 or higher */ ...@@ -569,7 +576,20 @@ OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 or higher */
printf(" nsupdate session key: %s\n", named_g_defaultsessionkeyfile); printf(" nsupdate session key: %s\n", named_g_defaultsessionkeyfile);
printf(" named PID file: %s\n", named_g_defaultpidfile); printf(" named PID file: %s\n", named_g_defaultpidfile);
printf(" named lock file: %s\n", named_g_defaultlockfile); printf(" named lock file: %s\n", named_g_defaultlockfile);
#if defined(HAVE_GEOIP2)
#define RTC(x) RUNTIME_CHECK((x) == ISC_R_SUCCESS)
isc_mem_create(&mctx);
RTC(cfg_parser_create(mctx, named_g_lctx, &parser));
RTC(named_config_parsedefaults(parser, &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_destroy(parser, &config);
cfg_parser_destroy(&parser);
isc_mem_detach(&mctx);
#endif /* HAVE_GEOIP2 */
} }
static void static void
......
...@@ -14760,7 +14760,7 @@ fi ;; #( ...@@ -14760,7 +14760,7 @@ fi ;; #(
MAXMINDDB_CFLAGS="-I$with_maxminddb/include" MAXMINDDB_CFLAGS="-I$with_maxminddb/include"
MAXMINDDB_LIBS="-L$with_maxminddb/libs" MAXMINDDB_LIBS="-L$with_maxminddb/lib"
CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS" CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS"
LDFLAGS="$LDFLAGS $MAXMINDDB_LIBS" LDFLAGS="$LDFLAGS $MAXMINDDB_LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MMDB_open" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MMDB_open" >&5
......
...@@ -563,7 +563,7 @@ AS_IF([test "$enable_geoip" = "yes"], ...@@ -563,7 +563,7 @@ AS_IF([test "$enable_geoip" = "yes"],
[ # default [ # default
AX_SAVE_FLAGS([maxminddb]) AX_SAVE_FLAGS([maxminddb])
MAXMINDDB_CFLAGS="-I$with_maxminddb/include" MAXMINDDB_CFLAGS="-I$with_maxminddb/include"
MAXMINDDB_LIBS="-L$with_maxminddb/libs" MAXMINDDB_LIBS="-L$with_maxminddb/lib"
CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS" CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS"
LDFLAGS="$LDFLAGS $MAXMINDDB_LIBS" LDFLAGS="$LDFLAGS $MAXMINDDB_LIBS"
AC_SEARCH_LIBS([MMDB_open], [maxminddb], AC_SEARCH_LIBS([MMDB_open], [maxminddb],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment