From 0f5785a6c441b043564f3ba26a39145aee74b1c2 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Thu, 23 Feb 2017 11:08:16 +0100 Subject: [PATCH] Throw an error when lua-conf-file can't be loaded This ensures we cannot start up if the file is unreadable. Closes #4939 --- pdns/pdns_recursor.cc | 8 +++++++- pdns/rec-lua-conf.cc | 7 +++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 900f7abd65..1776ccf15e 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -2704,7 +2704,13 @@ int serviceMain(int argc, char*argv[]) g_dnssecLogBogus = ::arg().mustDo("dnssec-log-bogus"); - loadRecursorLuaConfig(::arg()["lua-config-file"], ::arg().mustDo("daemon")); + try { + loadRecursorLuaConfig(::arg()["lua-config-file"], ::arg().mustDo("daemon")); + } + catch (PDNSException &e) { + L<