diff options
author | Warren <wes.p160@gmail.com> | 2019-03-14 14:34:17 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2019-03-14 14:34:17 +0300 |
commit | 0e8a12e2080b9044fcf7826250f4deadeccbc2bd (patch) | |
tree | 48c48b0a1bcb159c8d8c6bd4ccb1e65a5fa37d01 /lynis | |
parent | 820666f448c10ac992e67ea5e140aa24e5b702ba (diff) |
Quote WORKDIR directory existence in lynis (#653)
Quote both "${WORKDIR}/include" and "${WORKDIR}/db" directory existence check in if-statements to avoid "Fatal error: can't find directory" in case of a space-character in the ${WORKDIR} path.
Diffstat (limited to 'lynis')
-rwxr-xr-x | lynis | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -76,7 +76,7 @@ tINCLUDE_TARGETS="/usr/local/include/lynis /usr/local/lynis/include /usr/share/lynis/include ./include" # Default paths to check (CWD as last option, in case we run from standalone) for I in ${tINCLUDE_TARGETS}; do if [ "${I}" = "./include" ]; then - if [ -d ${WORKDIR}/include ]; then INCLUDEDIR="${WORKDIR}/include"; fi + if [ -d "${WORKDIR}/include" ]; then INCLUDEDIR="${WORKDIR}/include"; fi elif [ -d ${I} -a -z "${INCLUDEDIR}" ]; then INCLUDEDIR=${I} fi @@ -95,7 +95,7 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta DBDIR=""; tDB_TARGETS="/usr/local/share/lynis/db /usr/local/lynis/db /usr/share/lynis/db ./db" for I in ${tDB_TARGETS}; do if [ "${I}" = "./db" ]; then - if [ -d ${WORKDIR}/db ]; then DBDIR="${WORKDIR}/db"; fi + if [ -d "${WORKDIR}/db" ]; then DBDIR="${WORKDIR}/db"; fi elif [ -d ${I} -a -z "${DBDIR}" ]; then DBDIR="${I}" fi |