mirror of https://github.com/CISOfy/lynis.git
Show permission warning while allowing users to continue
This commit is contained in:
parent
69c3816115
commit
af31202091
21
lynis
21
lynis
|
@ -137,37 +137,38 @@
|
|||
echo "[!] Change ownership of ${INCLUDEDIR}/${FILE} to 'root' or similar (found: ${OWNER} with UID ${OWNERID})."
|
||||
echo ""
|
||||
echo " Command:"
|
||||
echo " # chown root:root ${INCLUDEDIR}/${FILE}"
|
||||
echo " # chown 0:0 ${INCLUDEDIR}/${FILE}"
|
||||
echo ""
|
||||
echo " Note: on some systems the default group might be 'wheel'. Use 'chown root:wheel' instead on the files."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ ${ISSUE} -eq 0 ]; then
|
||||
. ${INCLUDEDIR}/consts
|
||||
. ${INCLUDEDIR}/functions
|
||||
else
|
||||
# Now if there is an issue with permissions, show it to the user and let them decide how to continue.
|
||||
if [ ${ISSUE} -eq 1 ]; then
|
||||
echo ""; echo "";
|
||||
echo "[X] Security check failed: See action above, to correct this issue."
|
||||
echo ""
|
||||
echo " Why do I see this error?"
|
||||
echo " -------------------------------"
|
||||
echo " This is a protection mechanism, to prevent the root user from executing user created files."
|
||||
echo " This is a protection mechanism to prevent the root user from executing user created files."
|
||||
echo ""; echo ""
|
||||
echo " What can I do?"
|
||||
echo " ---------------------"
|
||||
echo " 1) Check if a trusted user created the files (e.g. you, by using Git, Homebrew or similar)"
|
||||
echo " 1) Check if a trusted user created the files, by using Git, Homebrew or similar"
|
||||
echo ""
|
||||
echo " 2) Change ownership and permissions of the related files (or full directory)."
|
||||
echo ""
|
||||
echo " Commands (full directory):"
|
||||
echo " # cd .."
|
||||
echo " # chown -R root:<GROUP TO WHICH ROOT BELONGS> lynis"
|
||||
echo " # chown -R 0:0 lynis"
|
||||
echo ""
|
||||
echo " 3) Start Lynis again (cd lynis && ./lynis)."
|
||||
echo ""; echo "";
|
||||
exit 1
|
||||
echo "[ Press ENTER to continue, or CTRL+C to cancel ]"
|
||||
read DUMMY
|
||||
fi
|
||||
. ${INCLUDEDIR}/consts
|
||||
. ${INCLUDEDIR}/functions
|
||||
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue