]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
checkconf better.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 15 Apr 2008 08:22:17 +0000 (08:22 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 15 Apr 2008 08:22:17 +0000 (08:22 +0000)
git-svn-id: file:///svn/unbound/trunk@1047 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
smallapp/unbound-checkconf.c
testdata/07-confroot.tpkg

index 35c346c52c7637d652209281bc14a5146e8bcdab..ec07246932fd849b8d204e28addec5d491ae4dde 100644 (file)
@@ -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.
index e06855d0d0150983e9617a1eb47c3dc7b61815a7..73aaea3006c016fe2373f31086d933a1bd5bb689 100644 (file)
@@ -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]) ||
index 435aedff09f47820cb18b90916e9b57d6ddb5f96..e25b089baeca0301af5fa82d908f448ed67daaef 100644 (file)
Binary files a/testdata/07-confroot.tpkg and b/testdata/07-confroot.tpkg differ