diff options
author | mboelen <michael@cisofy.com> | 2014-09-11 18:11:43 +0400 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2014-09-11 18:11:43 +0400 |
commit | b9a9aea340116da124f91bf9ce24adca1a79fb79 (patch) | |
tree | 4713f9162e6090f79f599b360faa11534b1bf75d | |
parent | 220777af7665a596b93f91323355e3aa43d8fa1d (diff) |
Adjusted file permissions, permissions check and storage of PID file
-rw-r--r-- | CHANGELOG | 6 | ||||
-rw-r--r-- | include/functions | 6 | ||||
-rwxr-xr-x | lynis | 5 |
3 files changed, 14 insertions, 3 deletions
@@ -18,6 +18,12 @@ ================================================================================ + * 1.6.2 (2014-09-xx) + + Changes: + - Permissions check has been adjusted to allow packaging and pentest mode + - Store PID file in home directory of user if needed + * 1.6.1 (2014-09-09) New: diff --git a/include/functions b/include/functions index 73750701..e9e972d1 100644 --- a/include/functions +++ b/include/functions @@ -210,6 +210,8 @@ LINESIZE=`echo "${TEXT}" | wc -c | tr -d ' '` SPACES=`expr 62 - ${INDENT} - ${LINESIZE}` if [ ${CRONJOB} -eq 0 ]; then + # Check if we already have already discovered a proper echo command tool. It not, set it default to 'echo'. + if [ "${ECHOCMD}" = "" ]; then ECHOCMD="echo"; fi ${ECHOCMD} "\033[${INDENT}C${TEXT}\033[${SPACES}C${RESULTPART}" else echo "${TEXT}${RESULTPART}" @@ -992,8 +994,8 @@ fi # Other permissions OTHER_PERMS=`echo ${PERMS} | cut -c8-10` - if [ ! "${OTHER_PERMS}" = "---" ]; then - echo "Fatal error: permissions of file $1 are not strict enough. Access to 'other' should be denied." + if [ ! "${OTHER_PERMS}" = "---" -a ! "${OTHER_PERMS}" = "r--" ]; then + echo "Fatal error: permissions of file $1 are not strict enough. Access to 'other' should be denied or read-only." ExitFatal fi # Set PERMS_OK to 1 if no fatal errors occurred @@ -347,7 +347,10 @@ # Create new PID file (use work directory if /var/run is not available) if [ ${PENTESTINGMODE} -eq 1 ]; then - PIDFILE="lynis.pid" + # Store it in home directory of user + MYHOMEDIR=`echo ~` + if [ "${MYHOMEDIR}" = "" ]; then HOMEDIR="/tmp"; fi + PIDFILE="${MYHOMEDIR}/lynis.pid" elif [ -d /var/run ]; then PIDFILE="/var/run/lynis.pid" else |