From 1d3c4454403eb038220f8fd075f0bc836b2e03ed Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 20 Nov 2012 10:08:06 +0100 Subject: regression fix: rsyslog terminated when wild-card $includeFile did not find files Unfortunately, this is often the case by default in many distros. --- grammar/rainerscript.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'grammar/rainerscript.c') diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 27ff5376..1116c913 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2757,6 +2757,9 @@ cnffuncNew(es_str_t *fname, struct cnffparamlst* paramlst) return func; } +/* returns 0 if everything is OK and config parsing shall continue, + * and 1 if things are so wrong that config parsing shall be aborted. + */ int cnfDoInclude(char *name) { @@ -2784,7 +2787,7 @@ cnfDoInclude(char *name) /* Silently ignore wildcards that match nothing */ if(result == GLOB_NOMATCH) { - return 1; + return 0; } if(result == GLOB_NOSPACE || result == GLOB_ABORTED) { @@ -2802,7 +2805,7 @@ cnfDoInclude(char *name) rs_strerror_r(errno, errStr, sizeof(errStr)); parser_errmsg("error accessing config file or directory '%s': %s", cfgFile, errStr); - continue; + return 1; } if(S_ISREG(fileInfo.st_mode)) { /* config file */ -- cgit v1.2.3