]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that unbound-checkconf does not complains if the config file
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 29 Nov 2018 12:55:13 +0000 (12:55 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 29 Nov 2018 12:55:13 +0000 (12:55 +0000)
  is not placed inside the chroot.

git-svn-id: file:///svn/unbound/trunk@4995 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
smallapp/unbound-checkconf.c

index 21b0e7fcccba8607a6d93caab0edd47f5e5b5ef0..82d91c1a8df639e8f23184dc1d1506d550c38bcf 100644 (file)
@@ -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.
index ea46479172c014bbb97e61385802c54a2601db65..eddd3e172821e30cb91286164cf0dbc30446a5e8 100644 (file)
@@ -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