[syslog-ng] [PATCH 1/2] pdbtool: Bail out on errors even if validating only.

Gergely Nagy algernon at balabit.hu
Mon Oct 31 18:16:11 CET 2011


When run with the --validate flag, and an error is detected, short
circuit to the next file, instead of running the rest of the
validation with garbled data.

Reported-by: Peter Czanik <czanik at balabit.hu>
Signed-off-by: Gergely Nagy <algernon at balabit.hu>
---
 modules/dbparser/pdbtool.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/dbparser/pdbtool.c b/modules/dbparser/pdbtool.c
index 13bc7d4..c2f9117 100644
--- a/modules/dbparser/pdbtool.c
+++ b/modules/dbparser/pdbtool.c
@@ -694,12 +694,14 @@ pdbtool_test(int argc, char *argv[])
             {
               fprintf(stderr, "%s: Unable to detect patterndb version, please write the <patterndb> tag on a single line\n", argv[arg_pos]);
               failed_to_validate = TRUE;
+	      continue;
             }
           g_snprintf(cmd, sizeof(cmd), "xmllint --noout --nonet --schema %s/patterndb-%d.xsd %s", PATH_XSDDIR, version, argv[arg_pos]);
           if (system(cmd) != 0)
             {
               fprintf(stderr, "%s: xmllint returned an error, the executed command was: %s", argv[arg_pos], cmd);
               failed_to_validate = TRUE;
+	      continue;
             }
         }
 
-- 
1.7.7.1




More information about the syslog-ng mailing list