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:
authorNeil Mayhew <neil@fpcomplete.com>2019-10-15 21:06:29 +0300
committerNeil Mayhew <neil@fpcomplete.com>2019-11-02 03:12:33 +0300
commit9de822767454e68b4a79574bcb058eee78f32287 (patch)
treeaddea4b49d71a4ab1866b09f97eaa81cc62a57f3 /include/tests_homedirs
parent0fe16a286e5671802582b10d33016a3cf9cdfdbb (diff)
Fix for false positive for some users on HOME-9306
Closes #773 Patch from @church1e
Diffstat (limited to 'include/tests_homedirs')
-rw-r--r--include/tests_homedirs8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/tests_homedirs b/include/tests_homedirs
index 9b8c9c64..4830b9a3 100644
--- a/include/tests_homedirs
+++ b/include/tests_homedirs
@@ -57,9 +57,9 @@
if [ ${SKIPTEST} -eq 0 ]; then
# Check if users' home directories permissions are 750 or more restrictive
FOUND=0
- for LINE in $(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }'); do
+ for LINE in $(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print $1 ":" $6}'); 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)
@@ -89,9 +89,9 @@
if [ ${SKIPTEST} -eq 0 ]; then
# Check if users own their home directories
FOUND=0
- for LINE in $(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print }'); do
+ for LINE in $(${EGREPBINARY} -v '^(daemon|git|halt|root|shutdown|sync)' ${ROOTDIR}etc/passwd | ${AWKBINARY} -F: '($7 !~ "/(false|nologin)$") { print $1 ":" $6}'); 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