When run in test mode (pdbtool test), check that a file exists, before trying to load it, and return a sensible error message in case it does not. Reported-By: Peter Czanik <czanik@balabit.hu> Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- modules/dbparser/pdbtool.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/modules/dbparser/pdbtool.c b/modules/dbparser/pdbtool.c index c2f9117..b11a91a 100644 --- a/modules/dbparser/pdbtool.c +++ b/modules/dbparser/pdbtool.c @@ -684,6 +684,13 @@ pdbtool_test(int argc, char *argv[]) for (arg_pos = 1; arg_pos < argc; arg_pos++) { + if (access (argv[arg_pos], R_OK) == -1) + { + fprintf(stderr, "%s: Unable to access the patterndb file\n", argv[arg_pos]); + failed_to_validate = TRUE; + continue; + } + if (test_validate) { gchar cmd[1024]; -- 1.7.7.1