Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Schuster <kristian.s@outlook.de>2019-09-26 22:24:15 +0300
committerKristian Schuster <kristian.s@outlook.de>2019-09-26 22:24:15 +0300
commitd17d30d6a7c7b208f731309d05cdcd9bf9eaacb0 (patch)
tree5dab5314356807578c2820ff13d35c317ed4f14d /include/functions
parente64e49a551434ba68570a04f0af374c559449697 (diff)
nginx-test: add log file detection for relative paths
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/functions b/include/functions
index 89626958..b96bb070 100644
--- a/include/functions
+++ b/include/functions
@@ -2181,8 +2181,9 @@
if [ ! "${VALUE}" = "" ]; then
# If multiple values follow, select first one
VALUE=$(echo ${VALUE} | awk '{ print $1 }')
- if [ ! -f ${VALUE} ]; then
- LogText "Result: could not find referenced log file ${VALUE} in nginx configuration"
+ # Find both, log files provided with full or relative path
+ if [ ! -f ${VALUE} -a ! -f "${CONFIG_FILE%nginx.conf}${VALUE}" ]; then
+ LogText "Result: could not find log file ${VALUE} referenced in nginx configuration"
NGINX_ACCESS_LOG_MISSING=1
fi
fi
@@ -2218,7 +2219,8 @@
# Check if log file exists
FILE=$(echo ${VALUE} | awk '{ print $1 }')
if [ ! "${FILE}" = "" ]; then
- if [ ! -f ${FILE} ]; then
+ # Find both, log files provided with full or relative path
+ if [ ! -f ${FILE} -a ! -f "${CONFIG_FILE%nginx.conf}${FILE}" ]; then
NGINX_ERROR_LOG_MISSING=1
fi
else