mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix that unbound-checkconf does not complains if the config file
is not placed inside the chroot. git-svn-id: file:///svn/unbound/trunk@4995 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
c417f733af
commit
81ded6124d
2 changed files with 4 additions and 15 deletions
|
|
@ -2,6 +2,8 @@
|
|||
- iana portlist updated.
|
||||
- Fix chroot auth-zone fix to remove chroot prefix.
|
||||
- tag for 1.8.2rc1.
|
||||
- Fix that unbound-checkconf does not complains if the config file
|
||||
is not placed inside the chroot.
|
||||
|
||||
28 November 2018: Wouter
|
||||
- Fix leak in chroot fix for auth-zone.
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ check_modules_exist(const char* module_conf)
|
|||
|
||||
/** check configuration for errors */
|
||||
static void
|
||||
morechecks(struct config_file* cfg, const char* fname)
|
||||
morechecks(struct config_file* cfg)
|
||||
{
|
||||
warn_hosts("stub-host", cfg->stubs);
|
||||
warn_hosts("forward-host", cfg->forwards);
|
||||
|
|
@ -463,19 +463,6 @@ morechecks(struct config_file* cfg, const char* fname)
|
|||
!is_dir(cfg->chrootdir)) {
|
||||
fatal_exit("bad chroot directory");
|
||||
}
|
||||
if(cfg->chrootdir && cfg->chrootdir[0]) {
|
||||
char buf[10240];
|
||||
buf[0] = 0;
|
||||
if(fname[0] != '/') {
|
||||
if(getcwd(buf, sizeof(buf)) == NULL)
|
||||
fatal_exit("getcwd: %s", strerror(errno));
|
||||
(void)strlcat(buf, "/", sizeof(buf));
|
||||
}
|
||||
(void)strlcat(buf, fname, sizeof(buf));
|
||||
if(strncmp(buf, cfg->chrootdir, strlen(cfg->chrootdir)) != 0)
|
||||
fatal_exit("config file %s is not inside chroot %s",
|
||||
buf, cfg->chrootdir);
|
||||
}
|
||||
if(cfg->directory && cfg->directory[0]) {
|
||||
char* ad = fname_after_chroot(cfg->directory, cfg, 0);
|
||||
if(!ad) fatal_exit("out of memory");
|
||||
|
|
@ -680,7 +667,7 @@ checkconf(const char* cfgfile, const char* opt, int final)
|
|||
config_delete(cfg);
|
||||
return;
|
||||
}
|
||||
morechecks(cfg, cfgfile);
|
||||
morechecks(cfg);
|
||||
check_mod(cfg, iter_get_funcblock());
|
||||
check_mod(cfg, val_get_funcblock());
|
||||
#ifdef WITH_PYTHONMODULE
|
||||
|
|
|
|||
Loading…
Reference in a new issue