]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix bug 221.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 9 Dec 2008 09:28:39 +0000 (09:28 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 9 Dec 2008 09:28:39 +0000 (09:28 +0000)
git-svn-id: file:///svn/unbound/trunk@1384 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
smallapp/unbound-checkconf.c

index fb882bb47c9c3cacf7058bab4ad467772436b816..afc30ad9e342a5665290eb12b50ea8c905235d94 100644 (file)
@@ -1,3 +1,7 @@
+9 December 2008: Wouter
+       - bug #221 fixed: unbound checkconf checks if key files exist if
+         remote control is enabled. Also fixed NULL printf when not chrooted.
+
 3 December 2008: Wouter
        - Fix problem reported by Jaco Engelbrecht where unbound-control stats
          freezes up unbound if this was compiled without threading, and
index 539710270edb0eded3c4199ce0a91ce8a1b3d4e7..4a0dd9c48f84499d7eb60947eb980bb9ed585223 100644 (file)
@@ -239,8 +239,12 @@ check_chroot_string(const char* desc, char** ss,
                *ss = fname_after_chroot(str, cfg, 1);
                if(!*ss) fatal_exit("out of memory");
                if(!is_file(*ss)) {
-                       fatal_exit("%s: \"%s\" does not exist in chrootdir %s", 
-                               desc, str, chrootdir);
+                       if(chrootdir && chrootdir[0])
+                               fatal_exit("%s: \"%s\" does not exist in "
+                                       "chrootdir %s", desc, str, chrootdir);
+                       else
+                               fatal_exit("%s: \"%s\" does not exist", 
+                                       desc, str);
                }
                /* put in a new full path for continued checking */
                free(str);
@@ -347,6 +351,18 @@ morechecks(struct config_file* cfg, const char* fname)
                endpwent();
        }
 #endif
+       if(cfg->remote_control_enable) {
+               check_chroot_string("server-key-file", &cfg->server_key_file,
+                       cfg->chrootdir, cfg);
+               check_chroot_string("server-cert-file", &cfg->server_cert_file,
+                       cfg->chrootdir, cfg);
+               if(!is_file(cfg->control_key_file))
+                       fatal_exit("control-key-file: \"%s\" does not exist",
+                               cfg->control_key_file);
+               if(!is_file(cfg->control_cert_file))
+                       fatal_exit("control-cert-file: \"%s\" does not exist",
+                               cfg->control_cert_file);
+       }
 
        localzonechecks(cfg);
 }