From: Vítězslav Kříž Date: Mon, 4 Dec 2017 14:15:33 +0000 (+0100) Subject: hints: server stop when root hints load failed X-Git-Tag: v1.5.1~8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69ea2043fd397ea7ceafe9395b1318045ed6b9f3;p=thirdparty%2Fknot-resolver.git hints: server stop when root hints load failed If user provides custom hints file with config option hints.root_file('file') resovler fail with error. Before it just silently pass and may fail when loading defaults file, which leads to confusing error message. --- diff --git a/modules/hints/hints.c b/modules/hints/hints.c index 00c73b8ff..ad3f66e0a 100644 --- a/modules/hints/hints.c +++ b/modules/hints/hints.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "daemon/engine.h" #include "lib/zonecut.h" @@ -570,6 +571,9 @@ static char* hint_root_file(void *env, struct kr_module *module, const char *arg struct engine *engine = env; struct kr_context *ctx = &engine->resolver; const char *err_msg = engine_hint_root_file(ctx, args); + if (err_msg) { + luaL_error(engine->L, "error when opening '%s': %s", args, err_msg); + } return strdup(err_msg ? err_msg : ""); }