]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4172. [bug] Named / named-checkconf didn't handle a view of CLASS0.
authorMark Andrews <marka@isc.org>
Wed, 12 Aug 2015 09:06:00 +0000 (19:06 +1000)
committerMark Andrews <marka@isc.org>
Wed, 12 Aug 2015 09:06:41 +0000 (19:06 +1000)
                        [RT #40265]

(cherry picked from commit 151f1bcd5efdc59a9727de7529c37664845203b7)

CHANGES
bin/tests/system/checkconf/good-class.conf [new file with mode: 0644]
lib/bind9/check.c

diff --git a/CHANGES b/CHANGES
index 04340af055574668ba9e448355cc0f1cae4704cf..9ef76a4b889d2ea702fc8f47794eae8e2e0a2da5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4172.  [bug]           Named / named-checkconf didn't handle a view of CLASS0.
+                       [RT #40265]
+
 4171.  [bug]           Fixed incorrect class checks in TSIG RR
                        implementation. [RT #40287]
 
diff --git a/bin/tests/system/checkconf/good-class.conf b/bin/tests/system/checkconf/good-class.conf
new file mode 100644 (file)
index 0000000..ff2693e
--- /dev/null
@@ -0,0 +1 @@
+view "example" class00 { };
index e7a0200ca9eda25a0d86195188d9f91fd8903ef2..caf80d6a159f175e6add6195166102ca77f838c9 100644 (file)
@@ -2898,6 +2898,7 @@ bind9_check_namedconf(const cfg_obj_t *config, isc_log_t *logctx,
                dns_rdataclass_t vclass = dns_rdataclass_in;
                const char *key = cfg_obj_asstring(vname);
                isc_symvalue_t symvalue;
+               unsigned int symtype;
 
                tresult = ISC_R_SUCCESS;
                if (cfg_obj_isstring(vclassobj)) {
@@ -2911,16 +2912,17 @@ bind9_check_namedconf(const cfg_obj_t *config, isc_log_t *logctx,
                                            "view '%s': invalid class %s",
                                            cfg_obj_asstring(vname), r.base);
                }
+               symtype = vclass + 1;
                if (tresult == ISC_R_SUCCESS && symtab != NULL) {
                        symvalue.as_cpointer = view;
-                       tresult = isc_symtab_define(symtab, key, vclass,
+                       tresult = isc_symtab_define(symtab, key, symtype,
                                                    symvalue,
                                                    isc_symexists_reject);
                        if (tresult == ISC_R_EXISTS) {
                                const char *file;
                                unsigned int line;
                                RUNTIME_CHECK(isc_symtab_lookup(symtab, key,
-                                          vclass, &symvalue) == ISC_R_SUCCESS);
+                                        symtype, &symvalue) == ISC_R_SUCCESS);
                                file = cfg_obj_file(symvalue.as_cpointer);
                                line = cfg_obj_line(symvalue.as_cpointer);
                                cfg_obj_log(view, logctx, ISC_LOG_ERROR,