From: Wouter Wijngaards Date: Tue, 15 Apr 2008 08:22:17 +0000 (+0000) Subject: checkconf better. X-Git-Tag: release-0.11~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=399a165cc32541b7eeef961641d4a6606b694e5b;p=thirdparty%2Funbound.git checkconf better. git-svn-id: file:///svn/unbound/trunk@1047 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 35c346c52..ec0724693 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,9 @@ 15 April 2008: Wouter - fixup default rc.d pidfile location to /usr/local/etc. + - iana ports updated. + - copyright updated in ldns-testpkts to keep same as in ldns. + - fixup checkconf chroot tests a bit more, chdir must be inside + chroot dir. 14 April 2008: Wouter - got update for parseunbound.pl statistics script from Kai Storbeck. diff --git a/smallapp/unbound-checkconf.c b/smallapp/unbound-checkconf.c index e06855d0d..73aaea300 100644 --- a/smallapp/unbound-checkconf.c +++ b/smallapp/unbound-checkconf.c @@ -321,8 +321,14 @@ morechecks(struct config_file* cfg) !is_dir(cfg->chrootdir)) { fatal_exit("bad chroot directory"); } - if(cfg->directory && cfg->directory[0] && - !is_dir(fname_after_chroot(cfg->directory, cfg, 0))) { + if((cfg->chrootdir && cfg->chrootdir[0]) + && (cfg->directory && cfg->directory[0]) + && strncmp(cfg->chrootdir, cfg->directory, + strlen(cfg->chrootdir)) != 0) { + fatal_exit("chdir directory '%s' not inside the chroot " + "directory '%s'", cfg->directory, cfg->chrootdir); + } + if(cfg->directory && cfg->directory[0] && !is_dir(cfg->directory)) { fatal_exit("bad chdir directory"); } if( (cfg->chrootdir && cfg->chrootdir[0]) || diff --git a/testdata/07-confroot.tpkg b/testdata/07-confroot.tpkg index 435aedff0..e25b089ba 100644 Binary files a/testdata/07-confroot.tpkg and b/testdata/07-confroot.tpkg differ