mirror of https://github.com/CISOfy/lynis.git
Use shell wildcard expansion now
This commit is contained in:
parent
6f6e21add2
commit
cd94da3449
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue