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
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2019-12-06 17:35:46 +0300
committerGitHub <noreply@github.com>2019-12-06 17:35:46 +0300
commit24c5a9fceae19b0ee1b7e2f1451bc57582eddc53 (patch)
treee244c877bf752296002e2e412ce05b013b701766 /include/tests_homedirs
parentd9013b13acf25199690a4c65f9fa337e6b9c8f67 (diff)
parentf93be8a44d8b46e19bb96d7001d30ef1aa4ca7d1 (diff)
Merge branch 'master' into master
Diffstat (limited to 'include/tests_homedirs')
-rw-r--r--include/tests_homedirs14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/tests_homedirs b/include/tests_homedirs
index e1cdc9b0..12251ae4 100644
--- a/include/tests_homedirs
+++ b/include/tests_homedirs
@@ -58,9 +58,9 @@
# Check if users' home directories permissions are 750 or more restrictive
FOUND=0
USERDATA=$(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }')
- while read -r LINE; do
+ while read -r LINE; do
USER=$(echo ${LINE} | ${CUTBINARY} -d: -f1)
- DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f6)
+ DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f2)
if [ -d "${DIR}" ]; then
WRITE_GROUP_PERM=$(${LSBINARY} -ld ${DIR} | ${CUTBINARY} -f1 -d" " | ${CUTBINARY} -c6)
OTHER_PERMS=$(${LSBINARY} -ld ${DIR} | ${CUTBINARY} -f1 -d" " | ${CUTBINARY} -c8-10)
@@ -72,7 +72,7 @@
fi
fi
done << EOF
-$USERDATA
+${USERDATA}
EOF
if [ ${FOUND} -eq 1 ]; then
@@ -92,10 +92,10 @@ EOF
if [ ${SKIPTEST} -eq 0 ]; then
# Check if users own their home directories
FOUND=0
- USERDATA=$(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }')
- while read -r LINE; do
+ USERDATA=$(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }')
+ while read -r LINE; do
USER=$(echo ${LINE} | ${CUTBINARY} -d: -f1)
- DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f6)
+ DIR=$(echo ${LINE} | ${CUTBINARY} -d: -f2)
if [ -d ${DIR} ]; then
OWNER=$(ls -ld ${DIR} | awk -F" " '{ print $3 }')
if [ ! "${OWNER}" = "${USER}" ]; then
@@ -106,7 +106,7 @@ EOF
fi
fi
done << EOF
-$USERDATA
+${USERDATA}
EOF
if [ ${FOUND} -eq 1 ]; then