diff options
Diffstat (limited to 'hscript/script_v.cc')
-rw-r--r-- | hscript/script_v.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hscript/script_v.cc b/hscript/script_v.cc index a5b85dc..9453c62 100644 --- a/hscript/script_v.cc +++ b/hscript/script_v.cc @@ -13,6 +13,11 @@ #include <algorithm> #include <map> #include <memory> +#ifdef HAS_INSTALL_ENV +# include <resolv.h> /* MAXNS */ +#else +# define MAXNS 3 /* default */ +#endif #include <set> #include <string> #include <vector> @@ -212,6 +217,12 @@ bool Horizon::Script::validate() const { for(auto &ns : internal->nses) { if(!ns->validate(opts)) failures++; } + if(internal->nses.size() > MAXNS) { + output_warning("installfile:" + + to_string(internal->nses[MAXNS]->lineno()), + "nameserver: more nameservers are defined than usable", + to_string(MAXNS) + " nameservers are allowed"); + } /* REQ: Runner.Validate.network.netssid */ for(auto &ssid : internal->ssids) { |