mirror of https://github.com/CISOfy/lynis.git
nginx-test: add log file detection for relative paths
This commit is contained in:
parent
e64e49a551
commit
d17d30d6a7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue