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
path: root/lynis
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-05-15 14:41:03 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-05-15 14:41:03 +0300
commit26c67e4ec677980b169b2056dff0e5315c2735d1 (patch)
tree2b1723c0128202a9f8afba7c7435d0ebce5587d0 /lynis
parent098f7685fc35ce8149b3107efd466b9e61b7dc4b (diff)
Use full paths when local directory is used for includedir or dbdir
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis27
1 files changed, 18 insertions, 9 deletions
diff --git a/lynis b/lynis
index da12f6d8..8fc594b9 100755
--- a/lynis
+++ b/lynis
@@ -56,11 +56,20 @@
#
#################################################################################
#
+ # Work directory
+ WORKDIR=`pwd`
+
# Test from which directories we can use all functions and tests
INCLUDEDIR="" # Set default include directory to none
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 [ -d ${I} ]; then INCLUDEDIR=${I}; fi; done
+ for I in ${tINCLUDE_TARGETS}; do
+ if [ "${I}" = "./include" ]; then
+ if [ -d ${WORKDIR}/include ]; then INCLUDEDIR="${WORKDIR}/include"; fi
+ elif [ -d ${I} ]; then
+ INCLUDEDIR=${I}
+ fi
+ done
# Drop out if our include directory can't be found
if [ "${INCLUDEDIR}" = "" ]; then
@@ -73,7 +82,13 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
# Test for database directory
DBDIR=""; tDB_TARGETS="/usr/local/share/lynis/db /usr/local/lynis/db /usr/share/lynis/db ./db"
- for I in ${tDB_TARGETS}; do if [ -d ${I} ]; then DBDIR=${I}; fi; done
+ for I in ${tDB_TARGETS}; do
+ if [ "${I}" = "./db" ]; then
+ if [ -d ${WORKDIR}/db ]; then DBDIR="${WORKDIR}/db"; fi
+ elif [ -d ${I} ]; then
+ DBDIR="${I}"
+ fi
+ done
#
#################################################################################
#
@@ -88,13 +103,7 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
#
#################################################################################
#
- WORKDIR=`pwd`
-#
-#################################################################################
-#
-
-# Consts
-# (bin paths, text strings, colors)
+# Consts (bin paths, text strings, colors)
#
#################################################################################
#