mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +02:00
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
|
# Check if path is absolute or relative
|
||||||
case $VALUE in
|
case $VALUE in
|
||||||
/*)
|
/*)
|
||||||
# Absolute path, so list files directly from that path
|
# Absolute path, so wildcard pattern is already correct
|
||||||
CONF_LS=$(${LSBINARY} ${VALUE%;*} 2>/dev/null) # Will error if wildcard doesn't match anything, so pipe stderr to /dev/null
|
CONF_WILDCARD=${VALUE%;*}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Relative path, so construct absolute path first to list files for
|
# Relative path, so construct absolute path for wildcard pattern
|
||||||
CONF_LS=$(${LSBINARY} ${CONFIG_FILE%nginx.conf}${VALUE%;*} 2>/dev/null)
|
CONF_WILDCARD=${CONFIG_FILE%nginx.conf}${VALUE%;*}
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
FOUND=0
|
||||||
for CONF in ${NGINX_CONF_FILES}; do
|
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
|
if [ "${CONF}" = "${FOUND_CONF}" ]; then FOUND=1; LogText "Found this file already in our configuration files array, not adding to queue"; fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user