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:
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/functions b/include/functions
index 60e213be..b88a7261 100644
--- a/include/functions
+++ b/include/functions
@@ -2310,15 +2310,20 @@
# Check if path is absolute or relative
case $VALUE in
/*)
- # Absolute path, so list files directly from that path
- CONF_LS=$(${LSBINARY} ${VALUE%;*} 2>/dev/null) # Will error if wildcard doesn't match anything, so pipe stderr to /dev/null
+ # Absolute path, so wildcard pattern is already correct
+ CONF_WILDCARD=${VALUE%;*}
;;
*)
- # Relative path, so construct absolute path first to list files for
- CONF_LS=$(${LSBINARY} ${CONFIG_FILE%nginx.conf}${VALUE%;*} 2>/dev/null)
+ # Relative path, so construct absolute path for wildcard pattern
+ CONF_WILDCARD=${CONFIG_FILE%nginx.conf}${VALUE%;*}
;;
esac
- for FOUND_CONF in CONF_LS; do
+ for FOUND_CONF in ${CONF_WILDCARD}; do
+ if [ "${FOUND_CONF}" = "${CONF_WILDCARD}" ]; then
+
+ LogText "Found no match for ${CONF_WILDCARD}"
+ break
+ fi
FOUND=0
for CONF in ${NGINX_CONF_FILES}; do
if [ "${CONF}" = "${FOUND_CONF}" ]; then FOUND=1; LogText "Found this file already in our configuration files array, not adding to queue"; fi