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-05-02 16:13:37 +0300
committermboelen <michael@cisofy.com>2016-05-02 16:13:37 +0300
commitd4f71e6d42483487852558d272f2c97837bd8f06 (patch)
tree800faa8a77012ef08945ff0d0cdd9386ddec4d84 /lynis
parent73bcfccd20b313c7ee01466985b0ae489ce9ab2c (diff)
Try creating a temporary log and report file in unprivileged mode
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis13
1 files changed, 9 insertions, 4 deletions
diff --git a/lynis b/lynis
index 798dfb9b..0f3a4ace 100755
--- a/lynis
+++ b/lynis
@@ -195,9 +195,14 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
# Disable logging if no alternative was provided
if [ ${PRIVILEGED} -eq 0 ]; then
if [ "${LOGFILE}" = "" ]; then
- LOGFILE="/dev/null"
+ # Try creating a log file in temporary directory
+ touch /tmp/lynis.log
+ if [ $? -eq 0 ]; then LOGFILE="/tmp/lynis.log"; else LOGFILE="/dev/null"; fi
+ fi
+ if [ "${REPORTFILE}" = "" ]; then
+ touch /tmp/lynis-report.dat
+ if [ $? -eq 0 ]; then REPORTFILE="/tmp/lynis-report.dat"; else REPORTFILE="/dev/null"; fi
fi
- if [ "${REPORTFILE}" = "" ]; then REPORTFILE="/dev/null"; fi
fi
#
#################################################################################
@@ -424,8 +429,8 @@ ${NORMAL}
"
if [ "${LOGFILE}" = "" -o "${LOGFILE}" = "/dev/null" ]; then
printf "%s" "
-${RED}WARNING:${NORMAL}
-${WHITE}*${NORMAL} No suggestions or warnings will be displayed in report (due to missing log file)
+ ${RED}WARNING:${NORMAL}
+ ${WHITE}*${NORMAL} No suggestions or warnings will be displayed in report (due to missing log file)
"
fi
printf "%s" "