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:
authormboelen <michael@cisofy.com>2016-04-13 13:09:26 +0300
committermboelen <michael@cisofy.com>2016-04-13 13:09:26 +0300
commitd3f33a32cd4de08fd026a4bf1335b6d541e63d7e (patch)
tree800f11607194591f3986de896cd16362d2b4050b /lynis
parent13f13739443a2539ac911551877a89f4fd3adb1f (diff)
Define default plugin directory after profiles have been parsed
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis72
1 files changed, 38 insertions, 34 deletions
diff --git a/lynis b/lynis
index 611adcce..a996e755 100755
--- a/lynis
+++ b/lynis
@@ -210,31 +210,6 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
#
#################################################################################
#
-# Plugins
-#
-#################################################################################
-#
- # Plugin directory test
- if [ "${PLUGINDIR}" = "" ]; then
- #logtext "Result: Searching for plugindir"
- tPLUGIN_TARGETS="/usr/local/lynis/plugins /usr/local/share/lynis/plugins /usr/share/lynis/plugins /etc/lynis/plugins ./plugins"
- for I in ${tPLUGIN_TARGETS}; do
- if [ -d ${I} ]; then
- PLUGINDIR=${I}
- Debug "Result: found plugindir ${PLUGINDIR}"
- fi
- done
- fi
-
- # Drop out if our plugin directory can't be found
- if [ ! -d ${PLUGINDIR} ]; then
- echo "Fatal error: can't find plugin directory ${PLUGINDIR}"
- echo "Make sure to execute ${PROGRAM_NAME} from untarred directory or check your installation."
- exit 1
- fi
-#
-#################################################################################
-#
# Program information
#
#################################################################################
@@ -530,6 +505,42 @@ ${NORMAL}
#
#################################################################################
#
+# Read profile/template/plugins
+#
+#################################################################################
+#
+ SafePerms ${INCLUDEDIR}/profiles
+ . ${INCLUDEDIR}/profiles
+#
+#################################################################################
+#
+# Plugins
+#
+#################################################################################
+#
+ # Plugin directory test
+ if [ "${PLUGINDIR}" = "" ]; then
+ #logtext "Result: Searching for plugindir"
+ tPLUGIN_TARGETS="/usr/local/lynis/plugins /usr/local/share/lynis/plugins /usr/share/lynis/plugins /etc/lynis/plugins ./plugins"
+ for I in ${tPLUGIN_TARGETS}; do
+ if [ -d ${I} ]; then
+ PLUGINDIR=${I}
+ Debug "Result: found plugindir ${PLUGINDIR}"
+ fi
+ done
+ else
+ Debug "Plugin was already set before to ${PLUGINDIR} (most likely via program argument or profile)"
+ fi
+
+ # Drop out if our plugin directory can't be found
+ if [ ! -d ${PLUGINDIR} ]; then
+ echo "Fatal error: can't find plugin directory ${PLUGINDIR}"
+ echo "Make sure to execute ${PROGRAM_NAME} from untarred directory or check your installation."
+ exit 1
+ fi
+#
+#################################################################################
+#
# Show program information to display
#
#################################################################################
@@ -577,19 +588,12 @@ ${NORMAL}
logtext "-----------------------------------------------------"
logtext "BusyBox used: ${SHELL_IS_BUSYBOX}"
+ report "plugin_directory=${PLUGINDIR}"
+
logtextbreak
#
#################################################################################
#
-# Read profile/template/plugins
-#
-#################################################################################
-#
- SafePerms ${INCLUDEDIR}/profiles
- . ${INCLUDEDIR}/profiles
-#
-#################################################################################
-#
# Check for program update (and friendly force people to upgrade)
#
#################################################################################