]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Tue, 11 Sep 2001 23:32:55 +0000 (23:32 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 11 Sep 2001 23:32:55 +0000 (23:32 +0000)
 989.   [bug]           Report filename if $INCLUDE fails for file related
                        errors. [RT #1736]

CHANGES
lib/dns/master.c

diff --git a/CHANGES b/CHANGES
index 21cff7b0f5dc4fb832844028e442df3d23e10002..d3330eee1b1b064d07061c0d677fffd2637ec186 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 
+ 989.  [bug]           Report filename if $INCLUDE fails for file related
+                       errors. [RT #1736]
+
  987.  [bug]           "dig -help" didn't show "+[no]stats".
 
  986.  [bug]           "dig +noall" failed to clear stats and command
index 0ccf95d88f9d6665f39abce05a94799dee5b299b..779147398ed445c3d1b54c2df7b0e5a766e7730c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: master.c,v 1.122.2.1 2001/09/04 22:51:37 gson Exp $ */
+/* $Id: master.c,v 1.122.2.2 2001/09/11 23:32:55 gson Exp $ */
 
 #include <config.h>
 
@@ -242,11 +242,22 @@ loadctx_destroy(dns_loadctx_t *lctx);
 #define MANYERRS(lctx, result) \
                ((result != ISC_R_SUCCESS) && \
                ((lctx)->options & DNS_MASTER_MANYERRORS) != 0)
+
 #define SETRESULT(lctx, r) \
                do { \
                        if ((lctx)->result == ISC_R_SUCCESS) \
                                (lctx)->result = r; \
                } while (0)
+
+#define LOGITFILE(result, filename) \
+       if (result == ISC_R_INVALIDFILE || result == ISC_R_FILENOTFOUND || \
+           result == ISC_R_IOERROR || result == ISC_R_TOOMANYOPENFILES || \
+           result == ISC_R_NOPERM) \
+               (*callbacks->error)(callbacks, "%s: %s:%lu: %s: %s", \
+                                   "dns_master_load", source, line, \
+                                   filename, dns_result_totext(result)); \
+       else LOGIT(result)
+
 #define LOGIT(result) \
        if (result == ISC_R_NOMEMORY) \
                (*callbacks->error)(callbacks, "dns_master_load: %s", \
@@ -944,10 +955,12 @@ load(dns_loadctx_t *lctx) {
                                                          ictx->origin, lctx);
                                        if (MANYERRS(lctx, result)) {
                                                SETRESULT(lctx, result);
-                                               LOGIT(result);
+                                               LOGITFILE(result, include_file);
                                                continue;
-                                       } else if (result != ISC_R_SUCCESS)
-                                               goto log_and_cleanup;
+                                       } else if (result != ISC_R_SUCCESS) {
+                                               LOGITFILE(result, include_file);
+                                               goto insist_and_cleanup;
+                                       }
                                        ictx = lctx->inc;
                                        line = isc_lex_getsourceline(lctx->lex);
                                        source =
@@ -1121,10 +1134,12 @@ load(dns_loadctx_t *lctx) {
                                result = pushfile(include_file, new_name, lctx);
                                if (MANYERRS(lctx, result)) {
                                        SETRESULT(lctx, result);
-                                       LOGIT(result);
+                                       LOGITFILE(result, include_file);
                                        continue;
-                               } else if (result != ISC_R_SUCCESS)
-                                       goto log_and_cleanup;
+                               } else if (result != ISC_R_SUCCESS) {
+                                       LOGITFILE(result, include_file);
+                                       goto insist_and_cleanup;
+                               }
                                ictx = lctx->inc;
                                line = isc_lex_getsourceline(lctx->lex);
                                source = isc_lex_getsourcename(lctx->lex);